Professional Documents
Culture Documents
Git Workflow 1 / 16
Goals of the presentation
Git Workflow 2 / 16
Workflows
Branches
Git Workflow 3 / 16
Example of bad splitting: per developer branches
Pro
Cons
Git Workflow 6 / 16
Code sharing: centralized workflow
Git Workflow 7 / 16
Code sharing: centralized workflow
Git Workflow 7 / 16
Centralized workflow
1 do {
2 while ( n o t hi n g _interesting () )
3 work () ;
4 while ( un co mm ited_changes () ) {
5 while (! happy ) { // git diff -- staged ?
6 while (! enough ) git add -p ;
7 while ( too_much ) git reset -p ;
8 }
9 git commit ; // no -a
10 if ( n o t hi n g _interesting () )
11 git stash ;
12 }
13 while (! happy )
14 git rebase -i ;
15 } while (! done ) ;
16 git push ; // send code to central repository
Git Workflow 8 / 16
Code sharing: Github workflow
Git Workflow 9 / 16
Code sharing: Github workflow
push
privately
• Contributors publish their
developer
integration work and ask for merge
private
repository
repository • Integrators merges then
publish the contributions
Git Workflow 9 / 16
Code sharing: Github workflow
Git Workflow 9 / 16
Code sharing: Github workflow
privately
• Contributors publish their
developer
integration work and ask for merge
private
repository
repository • Integrators merges then
publish the contributions
Git Workflow 9 / 16
Code sharing: Github workflow
push
push
ll
privately
• Contributors publish their
developer
integration work and ask for merge
private
repository
repository • Integrators merges then
publish the contributions
Public mailing list as public repository
Git patches can be send by email (git format-patch -1),
published in mailing-list (eg. bug-gnu-emacs@gnu.org), then
integrated (git am)
Git Workflow 9 / 16
Triangular Workflow with pull-requests
merge merge
B’s public repo Upstream A’s public repo
ll clo
push
push
u ne
,p ,p
ne ull
clo
B’s private repo A’s private repo
Git Workflow 10 / 16
Pull-requests in Practice
The code review is the major point for code quality insurance !
Git Workflow 11 / 16
Code Review
Git Workflow 12 / 16
Iterating Code Reviews
Git Workflow 13 / 16
Code sharing: Linux kernel workflow
dictator public
• Code review and basic
repository repository
filtering of contributions is
done by the lieutenants
lieutenant
• Final decision is done by the
public
repository benevolent dictator
• Lieutenant repositories are
developer developer the testbeds of new ideas
public public that mature in it before
repository repository
upstream submission
Git Workflow 14 / 16
Code sharing: remote management
Git Workflow 15 / 16
Branches and tags in practice
Branches and Tags in Practice
Git Workflow 16 / 16