cheltenham geeks - git talk/interactive session
DESCRIPTION
Presentation about the git source control system given to the Cheltenham Geeks group. This formed part of a longer interactive session in which the group followed along.TRANSCRIPT
git commit -m “Cheltenham Geeks”
Introduction to version control using git
Getting started
• git --version
• git --help
• git <command> --help
Configuration
• git config --global user.name "bob"
• git config --global user.email [email protected]
• git config --global core.editor vi
• git config --global color.ui true
Staging
Repository Stage Working Copy
add / rmcommit
checkout
After first commit on branch
Initial commit
Branch commit
master
branch
After commit on master
Initial commit
master branch
What is HEAD in git?
Initial commit
master branch
HEAD After "git checkout master"
What is HEAD in git?
Initial commit
master branch
HEADAfter "git checkout branch"
After merge from branch
Initial commit
master branch
After deleting branch
Initial commit
master
Fast forward merges
Initial commit
Branch commit
master
branch Branch commit
Fast forward merges
Initial commit
Branch commit
master
branchBranch commit
Rebase vs Merge
Initial commit
master branch
Rebase
Initial commit
master branch
patch re-applied
Rebase
Initial commit
master branch
Branching in centralised version control systems• This is an example from my current work project (using TFS)
• release
• release 0.1.0.0
• branch
• asteroid
• sputnik
• meteor
• cosmicdebris
• main
• Making and maintaining branches is expensive so they are created and setup and never changed
Branching in git
• Branching is fast
• Switching between branches is fast
• Branches can be thrown away easily
• Different workflows are possible
• Create, work on, merge, delete many branches in a single day
Distributed Version Control
Source: Eric Sink’s Version Control by Example
Distributed version control
• Integration manager workflow
Source: Pro Git (Scott Charon)
Distributed version control
• Dictator and lieutenant workflow
Source: Pro Git (Scott Charon)
Other topics
• Git hooks
• Stashing
• Patches
Further reading
• Version Control By Example (Eric Sink)
• http://www.ericsink.com/vcbe/html/index.html
• Pro Git (Scott Chacon)
• http://git-scm.com/book