SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
我和 Git 有个约会

   Part A :初识 Git


                      马利 (richard_ma)
       richard.ma.19850509@gmail.com
               Blog: www.richardma.org
我们将讨论些什么?


➔基本概念
➔基本操作


➔工作方式
本地版本控制系统
集中式版本控制系统
分布式版本控制系统
Git 的由来

   Linus 无奈的结果




一切伟大的行动和思想,
都有一个微不足道的开始!
Git 哲学
➔   速度
➔   简单的设计
➔   完全分布式
➔   对非线性开发模式的强力支持(允许上千个并行
    开发的分支)
➔   有能力高效管理类似 Linux 内核一样的超大规
    模项目(速度和数据量)
Git 仓库的整体结构
从源码编译安装
➔
                                 安装 Git
此部分省略若干字

➔安装编译好的包
$ sudo apt­get install git­core

Ubuntu 下的安装包说明
➔

    ➔ git-core                   git 核心
    ➔ git-arch git-cvs git-svn   支持相应的版本管理系统导入到 git
    ➔ git-web git-gui            对应的管理界面
    ➔ gitk                       管理 git 历史的图形化程序
    ➔ git-email                  支持 git 发送邮件
    ➔ git-daemon-run             支持 git:// 协议访问
    ➔ git-buildpackage           deb 包打包的脚本
    ➔ gitosis                    创建 git 服务器的脚本
    ➔ git-doc                    有关 git 的文档
创建仓库
➔初始化一个空的仓库
$ mkdir project­name
$ cd project­name
$ git init

➔将现有本地仓库和远程仓库关联
$ git remote add 
[name: origin] 
git@github.com:user­name/project­name.git

➔从其他已有仓库 clone
$ git clone 
git@github.com:user­name/project­name.git 
[project­name]
操纵本地仓库
➔将文件纳入版本控制
$ git add simple­file.c

➔提交修改
$ git commit

➔签出代码
$ git checkout

➔查看状态
$ git status
$ git log
与远程仓库同步
➔推送到远程服务器
$ git push 
<remote­name: origin> 
<branch­name: master>

➔从远程服务器获得更新
$ git fetch 
<remote­name: origin>    手动合并 branch
<branch­name: master>

$ git pull 
<remote­name: origin>    自动合并 branch
<branch­name: master>
工作流 A :集中模式
工作流 B :司令官模式
工作流 C :司令官副官模式
Questions?
参考文献


✔Git Documents
安装 git-doc 包, /usr/share/doc/git-doc

✔Pro Git
http://www.progit.org

✔Ubuntu 安装包说明
http://hi.chibaole.com/blog/2009/12/16/ 在 ubuntu 下安装 git/

Weitere ähnliche Inhalte

Was ist angesagt?

Android 程式設計(4)
Android 程式設計(4)Android 程式設計(4)
Android 程式設計(4)Roy Wang
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗Simon Su
 
初心者 Git 上手攻略
初心者 Git 上手攻略初心者 Git 上手攻略
初心者 Git 上手攻略Lucien Lee
 
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用Will Huang
 
Git内部培训文档
Git内部培训文档Git内部培训文档
Git内部培训文档superwen
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學littlebtc
 
Git &amp; git hub v1.2
Git &amp; git hub v1.2Git &amp; git hub v1.2
Git &amp; git hub v1.2Chris Chen
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战icy leaf
 
A successful git branching model 導讀
A successful git branching model 導讀A successful git branching model 導讀
A successful git branching model 導讀Wen Liao
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹Max Ma
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養Philip Zheng
 
連哈秋都懂的Git教學
連哈秋都懂的Git教學連哈秋都懂的Git教學
連哈秋都懂的Git教學hydai
 
Git & Sourcetree 介紹
Git & Sourcetree 介紹Git & Sourcetree 介紹
Git & Sourcetree 介紹Adison wu
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub維佋 唐
 
[China merge world tour] Perforce Introducing Git Fusion
[China   merge world tour] Perforce Introducing Git Fusion[China   merge world tour] Perforce Introducing Git Fusion
[China merge world tour] Perforce Introducing Git FusionPerforce
 
容器式軟體開發介紹
容器式軟體開發介紹容器式軟體開發介紹
容器式軟體開發介紹Philip Zheng
 

Was ist angesagt? (20)

Android 程式設計(4)
Android 程式設計(4)Android 程式設計(4)
Android 程式設計(4)
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗
 
初心者 Git 上手攻略
初心者 Git 上手攻略初心者 Git 上手攻略
初心者 Git 上手攻略
 
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
 
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
 
Git内部培训文档
Git内部培训文档Git内部培训文档
Git内部培训文档
 
Git介绍
Git介绍Git介绍
Git介绍
 
20150313 ian git
20150313 ian git20150313 ian git
20150313 ian git
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學
 
Git &amp; git hub v1.2
Git &amp; git hub v1.2Git &amp; git hub v1.2
Git &amp; git hub v1.2
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战
 
A successful git branching model 導讀
A successful git branching model 導讀A successful git branching model 導讀
A successful git branching model 導讀
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養
 
連哈秋都懂的Git教學
連哈秋都懂的Git教學連哈秋都懂的Git教學
連哈秋都懂的Git教學
 
Git & Sourcetree 介紹
Git & Sourcetree 介紹Git & Sourcetree 介紹
Git & Sourcetree 介紹
 
Github簡介
Github簡介Github簡介
Github簡介
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub
 
[China merge world tour] Perforce Introducing Git Fusion
[China   merge world tour] Perforce Introducing Git Fusion[China   merge world tour] Perforce Introducing Git Fusion
[China merge world tour] Perforce Introducing Git Fusion
 
容器式軟體開發介紹
容器式軟體開發介紹容器式軟體開發介紹
容器式軟體開發介紹
 

Andere mochten auch

Doc 2011101410543721
Doc 2011101410543721Doc 2011101410543721
Doc 2011101410543721Rhythm Sun
 
Doc 2011101404575913
Doc 2011101404575913Doc 2011101404575913
Doc 2011101404575913Rhythm Sun
 
Adorable python
Adorable pythonAdorable python
Adorable pythonRhythm Sun
 
Sunpinyin and it's future
Sunpinyin and it's futureSunpinyin and it's future
Sunpinyin and it's futureRhythm Sun
 
Doc 2011101412020074
Doc 2011101412020074Doc 2011101412020074
Doc 2011101412020074Rhythm Sun
 
M5. L'entrevista
M5. L'entrevistaM5. L'entrevista
M5. L'entrevistatcborges
 

Andere mochten auch (8)

Doc 2011101410543721
Doc 2011101410543721Doc 2011101410543721
Doc 2011101410543721
 
Doc 2011101404575913
Doc 2011101404575913Doc 2011101404575913
Doc 2011101404575913
 
Linuxdeepin
LinuxdeepinLinuxdeepin
Linuxdeepin
 
Adorable python
Adorable pythonAdorable python
Adorable python
 
Using vim
Using vimUsing vim
Using vim
 
Sunpinyin and it's future
Sunpinyin and it's futureSunpinyin and it's future
Sunpinyin and it's future
 
Doc 2011101412020074
Doc 2011101412020074Doc 2011101412020074
Doc 2011101412020074
 
M5. L'entrevista
M5. L'entrevistaM5. L'entrevista
M5. L'entrevista
 

Ähnlich wie First meetingwithgit

Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshellNelson Tai
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to gitBo-Yi Wu
 
Git Essence Tutorial
Git Essence TutorialGit Essence Tutorial
Git Essence TutorialHo Kim
 
Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Cloud Tu
 
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報Bachue Zhou
 
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)flylon
 
20170510 git 懶人包
20170510 git 懶人包20170510 git 懶人包
20170510 git 懶人包Chen-Ming Yang
 
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹PingLun Liao
 
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Wen-Tien Chang
 
Learn git
Learn gitLearn git
Learn git甘 李
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTreeChu-Siang Lai
 
Github简介及实用入门
Github简介及实用入门Github简介及实用入门
Github简介及实用入门Rongxing Liu
 
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用容器與 Gitlab CI 應用
容器與 Gitlab CI 應用Philip Zheng
 
Git introduction
Git introductionGit introduction
Git introductionmythnc
 
Git原理与实战 201607
Git原理与实战 201607Git原理与实战 201607
Git原理与实战 201607Charles Tang
 

Ähnlich wie First meetingwithgit (20)

Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Essence Tutorial
Git Essence TutorialGit Essence Tutorial
Git Essence Tutorial
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)
 
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
 
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
 
20170510 git 懶人包
20170510 git 懶人包20170510 git 懶人包
20170510 git 懶人包
 
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
 
Git基础培训
Git基础培训Git基础培训
Git基础培训
 
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
 
Learn git
Learn gitLearn git
Learn git
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTree
 
Github简介及实用入门
Github简介及实用入门Github简介及实用入门
Github简介及实用入门
 
Git 实战
Git 实战Git 实战
Git 实战
 
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
 
Git 教學
Git 教學Git 教學
Git 教學
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git share
Git shareGit share
Git share
 
Git原理与实战 201607
Git原理与实战 201607Git原理与实战 201607
Git原理与实战 201607
 

Mehr von Rhythm Sun

长连接服务 WebSocket Service
长连接服务 WebSocket Service长连接服务 WebSocket Service
长连接服务 WebSocket ServiceRhythm Sun
 
Trello workflow by @imRhythm
Trello workflow by @imRhythmTrello workflow by @imRhythm
Trello workflow by @imRhythmRhythm Sun
 
Bitcoin and retail
Bitcoin and retailBitcoin and retail
Bitcoin and retailRhythm Sun
 
Garage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_videoGarage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_videoRhythm Sun
 
Doc 2011101411284862
Doc 2011101411284862Doc 2011101411284862
Doc 2011101411284862Rhythm Sun
 
Doc 2010050608572429
Doc 2010050608572429Doc 2010050608572429
Doc 2010050608572429Rhythm Sun
 
火狐2011 sfd讲稿
火狐2011 sfd讲稿火狐2011 sfd讲稿
火狐2011 sfd讲稿Rhythm Sun
 
Customize snipmate
Customize snipmateCustomize snipmate
Customize snipmateRhythm Sun
 

Mehr von Rhythm Sun (11)

长连接服务 WebSocket Service
长连接服务 WebSocket Service长连接服务 WebSocket Service
长连接服务 WebSocket Service
 
Trello workflow by @imRhythm
Trello workflow by @imRhythmTrello workflow by @imRhythm
Trello workflow by @imRhythm
 
Bitcoin and retail
Bitcoin and retailBitcoin and retail
Bitcoin and retail
 
Garage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_videoGarage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_video
 
Beginning git
Beginning gitBeginning git
Beginning git
 
Doc 2011101411284862
Doc 2011101411284862Doc 2011101411284862
Doc 2011101411284862
 
Doc 2010050608572429
Doc 2010050608572429Doc 2010050608572429
Doc 2010050608572429
 
Outside
OutsideOutside
Outside
 
火狐2011 sfd讲稿
火狐2011 sfd讲稿火狐2011 sfd讲稿
火狐2011 sfd讲稿
 
Customize snipmate
Customize snipmateCustomize snipmate
Customize snipmate
 
Zsh
ZshZsh
Zsh
 

First meetingwithgit