SlideShare a Scribd company logo
1 of 4
Download to read offline
SVN                                            GIT

Server                    Server
History                   (remote)

                                              INTERNET                      面對它
                                                                            fetch

                         Server cache                                pull
                commit
                         (FETCH_HEAD)
                                                                                                 放下它
                                                                                    接受它          push
                                                                                    merge


                         History
                         (index)


                                                                                        處理它
Working                                                                                 commit
tree                     To be
                         committed
                         (stage)                         commit -a

                                                 add
                                                add -p

                          Working
                          tree          add


                 add


Untracked                 Untracked
Branch
     ( 僅供參考 )




master
(RD)


testing
(PM)

release
(Client)




   Tag
                milestone 1   milestone 2   version 1   version 2
.gitignore
●   To keep generated files out of repository.
    –   Eg : *.apk *.o bin/ cache/
●   Templates: https://github.com/github/gitignore
submodule+branch
   App Workspace                    libUtil



                             libUtil
                           App branch
   App       libUtil

                       cd app_workspace/
                       git submodule add git@blah.net:libUtil.git libUtil

                       cd libUtil/
                       git branch app
                       git checkout app
                       //edit something
                       git commit -a -m 'changes for app'
                       git push origin app
                       cd ../

                       git add .gitmodules libUtil/
                       git commit -m 'import libUtil'

More Related Content

Similar to Git

Similar to Git (20)

Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Session git
Session gitSession git
Session git
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Git
GitGit
Git
 
Git
GitGit
Git
 
T3dd10 git
T3dd10 gitT3dd10 git
T3dd10 git
 
Getting started with GIT
Getting started with GITGetting started with GIT
Getting started with GIT
 
Git
GitGit
Git
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
1004 z2 env_positioned
1004 z2 env_positioned1004 z2 env_positioned
1004 z2 env_positioned
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Basic Git
Basic GitBasic Git
Basic Git
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
 
Git
GitGit
Git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 

Git

  • 1. SVN GIT Server Server History (remote) INTERNET 面對它 fetch Server cache pull commit (FETCH_HEAD) 放下它 接受它 push merge History (index) 處理它 Working commit tree To be committed (stage) commit -a add add -p Working tree add add Untracked Untracked
  • 2. Branch ( 僅供參考 ) master (RD) testing (PM) release (Client) Tag milestone 1 milestone 2 version 1 version 2
  • 3. .gitignore ● To keep generated files out of repository. – Eg : *.apk *.o bin/ cache/ ● Templates: https://github.com/github/gitignore
  • 4. submodule+branch App Workspace libUtil libUtil App branch App libUtil cd app_workspace/ git submodule add git@blah.net:libUtil.git libUtil cd libUtil/ git branch app git checkout app //edit something git commit -a -m 'changes for app' git push origin app cd ../ git add .gitmodules libUtil/ git commit -m 'import libUtil'