4. Local Version Control
Local version control central
repository
• Bad for collaboration
• Error prone
• Possibility to overwrite the wrong files
5. Centralized Version Control
Centralized version control
• More control
• Better for sharing
• Better for collaboration,
but,
• Server is needed for every action
(commit, checkout, history)
• Single point of failure
6. Distributed Version Control
Distributed version control
• Better for collaboration
• Every clone is a copy of the repository
• With the exception of pull and push, every
action is local!
• Very fast!
7. Git
$ git clone <repo-url>
$ git status
$ git checkout -b new-stuff
< do some stuff (good and tested stuff) >
$ git add <files>
$ git status
$ git commit -m ‘My awesome development’
$ git pull
$ git push -u origin new-stuff
8. Git - The Three States
source: http://git-scm.com/
15. Git Workflow - Working in teams
What is a workflow and how to define it?
There is more than one workflow:
• Centralized workflow
• Feature branch workflow
• Git Flow workflow
• Forking workflow
16. Git Workflow - Working in teams
Parallel Development
Using feature branches isolates the development in progress from finished work.
Feature branch are used to develop new features that are integrated (merged)
only when done!
17. Git Workflow - Working in teams
Release Staging Area
Complete work needs to be
integrated all together in one place.
There should be a specific branch
to do continuous integration,
validating every contribution to the
code base by building the
application and running tests.
18. Git Workflow - Working in teams
Support For Emergency Fixes
Hotfixes should be easy to do not blocked by
current development. Hotfix branches should
only contain the code needed to solve the
issue.
19. Git Workflow - Working in teams
Git Flow (Vincent Driesen)
Branches
• master (production ready)
• develop (integration)
• feature (new features)
• release (support release preparation)
• hotfix (quick production fix)
20. Git Workflow - Working in teams
Infinite lifetime branches