Basics and Team Workflow
Version Control
Local version control with folders
Version Control
Local version control with folders
Local Version Control
Local version control central
repository
• Bad for collaboration
• Error prone
• Possibility to overwrite the wrong files
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
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!
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
Git - The Three States
source: http://git-scm.com/
Git Branching
source: http://git-scm.com/
Storing data as changes to a base version of each file.
Git Branching
source: http://git-scm.com/
Storing data as snapshots of the project over time.
Git Branching
source: http://git-scm.com/
Git Branching
source: http://git-scm.com/
Git Branching
source: http://git-scm.com/
Git Log
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
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!
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.
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.
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)
Git Workflow - Working in teams
Infinite lifetime branches
Git Workflow - Working in teams
Feature Branches
Git Workflow - Working in teams
Release Branches
Git Workflow - Working in teams
Hotfix Branches
Pull request
Pull request
Where to find me
www.ciromiranda.pt
@ciromiranda
Thank you
• https://guides.github.com/introduction/flow/
• https://www.atlassian.com/git/tutorials/compa
ring-workflows/
• https://try.github.io/levels/1/challenges/1
• http://git-scm.com/book/en/v2/
• http://nvie.com/posts/a-successful-git-
branching-model/
source: https://m.xkcd.com/1597/
Top Related