Enterprise Git
Pedro Melo
<{xmpp,mailto}:melo@simplicidade.org>
About Git...
About Git...
an unpleasant or contemptible person
Why Git?
Why Git?
• Fast, secure, safe, solid
Why Git?
• Fast, secure, safe, solid
• Great collaboration tools: built-in and from
third parties
Why Git?
• Fast, secure, safe, solid
• Great collaboration tools: built-in and from
third parties
• Distributed (think offl...
Why Git?
• Fast, secure, safe, solid
• Great collaboration tools: built-in and from
third parties
• Distributed (think offl...
Why Git?
• Fast, secure, safe, solid
• Great collaboration tools: built-in and from
third parties
• Distributed (think offl...
Adoption challenges
Adoption challenges
The devil you know....
Adoption challenges
Adoption challenges
Centralized vs Distributed
Adoption challenges
Adoption challenges
Liberal branching
Tools
Git “Server”
Git “Server”
• “Server” is what you want it to be: an SSH
account, a simple HTTP server, or a CGI-
capable HTTP server
Git “Server”
• “Server” is what you want it to be: an SSH
account, a simple HTTP server, or a CGI-
capable HTTP server
• N...
Git “Server”
• “Server” is what you want it to be: an SSH
account, a simple HTTP server, or a CGI-
capable HTTP server
• N...
Git “Server”
• “Server” is what you want it to be: an SSH
account, a simple HTTP server, or a CGI-
capable HTTP server
• N...
Centralized Git Servers
Centralized Git Servers
Gitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user
...
Centralized Git Servers
Gitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user
...
Centralized Git Servers
Gitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user
...
Centralized Git Servers
Gitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user
...
Git + Project Mgmt
Git + Project Mgmt
• OSS
• Redmine
• Trac
• Hosted
• Github (also has in-house solution)
• CodeBaseHQ
Git + Project Mgmt
• OSS
• Redmine
• Trac
• Hosted
• Github (also has in-house solution)
• CodeBaseHQ
Git + Project Mgmt
• OSS
• Redmine
• Trac
• Hosted
• Github (also has in-house solution)
• CodeBaseHQ
One final tool...
One final tool...
• Hudson
One final tool...
• Hudson
• Continuous integration solution
One final tool...
• Hudson
• Continuous integration solution
• Integrates very well with Git
One final tool...
• Hudson
• Continuous integration solution
• Integrates very well with Git
• Its *very* easy to install
One final tool...
• Hudson
• Continuous integration solution
• Integrates very well with Git
• Its *very* easy to install
•...
Team organization
Linux Kernel
General
Lieutenant
A
Lieutenant
B
Lieutenant
C
Official
Army
Common organization
Developers
Smoker Collaboration Production
Lets talk about
merging...
Merge
master
Merge
master
feature
git checkout -b feature
Merge
feature
master
Merge
feature
master
git checkout master; git merge feature
Merge
feature
master
git checkout master; git reset --hard master^
git checkout master; git reset --hard HEAD^
Merge
master
feature
git checkout feature; git merge master
Merge
feature
master
git checkout master; git merge feature
Merge
master
feature
Rebase
feature
master
Rebase
feature
master
A B C
X Y Z
Rebase
master
A B C
X Y Z
X' Y' Z'
feature
git checkout feature; git rebase master
Rebase
master
A B C
X Y Z
X' Y' Z'
feature
dAX
dXY dYZ
dAX'
dXY' dYZ'
Rebase
master
A B C
X Y Z
X' Y' Z'
feature
Rebase
A B C
X Y Z
X' Y' Z'
feature
master
git checkout master; git merge feature
Rebase
master
A B C
X Y Z
X' Y' Z'
feature
Rebase
A B C
X Y Z
X' Y' Z'
feature
D
master
git checkout master; git merge --no-ff feature
Branch naming
git branches
• Byte strings, so mixing codepages bad idea
• Use directories to organize branches
• feature/*, test/*, <dev...
Project phases
Project phases
• Production
Project phases
• Production
• Releases
Project phases
• Production
• Releases
• Staging
Project phases
• Production
• Releases
• Staging
• Features
Project phases
• Production
• Releases
• Staging
• Features
• Celsadas HotFixes
Common branch
names
Common branch
names
• Everybody has a production branch: master
Common branch
names
• Everybody has a production branch: master
• Release branches: release/*
Common branch
names
• Everybody has a production branch: master
• Release branches: release/*
• New features get a branch ...
Common branch
names
• Everybody has a production branch: master
• Release branches: release/*
• New features get a branch ...
Common branch
names
• Everybody has a production branch: master
• Release branches: release/*
• New features get a branch ...
Common branch
names
• Everybody has a production branch: master
• Release branches: release/*
• New features get a branch ...
Conclusions
Conclusions
• Git is ready for big teams
Conclusions
• Git is ready for big teams
• Git is also ready for small teams
Conclusions
• Git is ready for big teams
• Git is also ready for small teams
• There is no right way...
Conclusions
• Git is ready for big teams
• Git is also ready for small teams
• There is no right way...
• ... but start wi...
Conclusions
• Git is ready for big teams
• Git is also ready for small teams
• There is no right way...
• ... but start wi...
Obrigado!
Pedro Melo
melo@simplicidade.org
@pedromelo
Questions about Git, Perl,
XMPP, just find me and ask away
I’ll be here the thr...
Upcoming SlideShare
Loading in...5
×

Enterprise git

1,301

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,301
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Enterprise git

  1. 1. Enterprise Git Pedro Melo <{xmpp,mailto}:melo@simplicidade.org>
  2. 2. About Git...
  3. 3. About Git... an unpleasant or contemptible person
  4. 4. Why Git?
  5. 5. Why Git? • Fast, secure, safe, solid
  6. 6. Why Git? • Fast, secure, safe, solid • Great collaboration tools: built-in and from third parties
  7. 7. Why Git? • Fast, secure, safe, solid • Great collaboration tools: built-in and from third parties • Distributed (think offline mode, freedom to tinker)
  8. 8. Why Git? • Fast, secure, safe, solid • Great collaboration tools: built-in and from third parties • Distributed (think offline mode, freedom to tinker) • Cross-platform: UNIX, Mac OS X,Windows
  9. 9. Why Git? • Fast, secure, safe, solid • Great collaboration tools: built-in and from third parties • Distributed (think offline mode, freedom to tinker) • Cross-platform: UNIX, Mac OS X,Windows • Proven track record: Linux Kernel, KDE, X.org, KDE, Gnome,Android, Debian, Fedora, openSUSE, Mono, Perl, Ruby, Samba, PostgreSQL,Wine, and many others
  10. 10. Adoption challenges
  11. 11. Adoption challenges The devil you know....
  12. 12. Adoption challenges
  13. 13. Adoption challenges Centralized vs Distributed
  14. 14. Adoption challenges
  15. 15. Adoption challenges Liberal branching
  16. 16. Tools
  17. 17. Git “Server”
  18. 18. Git “Server” • “Server” is what you want it to be: an SSH account, a simple HTTP server, or a CGI- capable HTTP server
  19. 19. Git “Server” • “Server” is what you want it to be: an SSH account, a simple HTTP server, or a CGI- capable HTTP server • No centralized server built-in concept
  20. 20. Git “Server” • “Server” is what you want it to be: an SSH account, a simple HTTP server, or a CGI- capable HTTP server • No centralized server built-in concept • One or more repositories in well-known locations become the central repository
  21. 21. Git “Server” • “Server” is what you want it to be: an SSH account, a simple HTTP server, or a CGI- capable HTTP server • No centralized server built-in concept • One or more repositories in well-known locations become the central repository • Social convention wins
  22. 22. Centralized Git Servers
  23. 23. Centralized Git Servers Gitosis Gitolite Managed by git Managed by git + shell Maintained? Active development repo x user repo x user x branch x action
  24. 24. Centralized Git Servers Gitosis Gitolite Managed by git Managed by git + shell Maintained? Active development repo x user repo x user x branch x action
  25. 25. Centralized Git Servers Gitosis Gitolite Managed by git Managed by git + shell Maintained? Active development repo x user repo x user x branch x action
  26. 26. Centralized Git Servers Gitosis Gitolite Managed by git Managed by git + shell Maintained? Active development repo x user repo x user x branch x action
  27. 27. Git + Project Mgmt
  28. 28. Git + Project Mgmt • OSS • Redmine • Trac • Hosted • Github (also has in-house solution) • CodeBaseHQ
  29. 29. Git + Project Mgmt • OSS • Redmine • Trac • Hosted • Github (also has in-house solution) • CodeBaseHQ
  30. 30. Git + Project Mgmt • OSS • Redmine • Trac • Hosted • Github (also has in-house solution) • CodeBaseHQ
  31. 31. One final tool...
  32. 32. One final tool... • Hudson
  33. 33. One final tool... • Hudson • Continuous integration solution
  34. 34. One final tool... • Hudson • Continuous integration solution • Integrates very well with Git
  35. 35. One final tool... • Hudson • Continuous integration solution • Integrates very well with Git • Its *very* easy to install
  36. 36. One final tool... • Hudson • Continuous integration solution • Integrates very well with Git • Its *very* easy to install • ... and it has Chuck Norris quotes!
  37. 37. Team organization
  38. 38. Linux Kernel General Lieutenant A Lieutenant B Lieutenant C Official Army
  39. 39. Common organization Developers Smoker Collaboration Production
  40. 40. Lets talk about merging...
  41. 41. Merge master
  42. 42. Merge master feature git checkout -b feature
  43. 43. Merge feature master
  44. 44. Merge feature master git checkout master; git merge feature
  45. 45. Merge feature master git checkout master; git reset --hard master^ git checkout master; git reset --hard HEAD^
  46. 46. Merge master feature git checkout feature; git merge master
  47. 47. Merge feature master git checkout master; git merge feature
  48. 48. Merge master feature
  49. 49. Rebase feature master
  50. 50. Rebase feature master A B C X Y Z
  51. 51. Rebase master A B C X Y Z X' Y' Z' feature git checkout feature; git rebase master
  52. 52. Rebase master A B C X Y Z X' Y' Z' feature dAX dXY dYZ dAX' dXY' dYZ'
  53. 53. Rebase master A B C X Y Z X' Y' Z' feature
  54. 54. Rebase A B C X Y Z X' Y' Z' feature master git checkout master; git merge feature
  55. 55. Rebase master A B C X Y Z X' Y' Z' feature
  56. 56. Rebase A B C X Y Z X' Y' Z' feature D master git checkout master; git merge --no-ff feature
  57. 57. Branch naming
  58. 58. git branches • Byte strings, so mixing codepages bad idea • Use directories to organize branches • feature/*, test/*, <dev_handle>/* • Think globally to minimize clashes
  59. 59. Project phases
  60. 60. Project phases • Production
  61. 61. Project phases • Production • Releases
  62. 62. Project phases • Production • Releases • Staging
  63. 63. Project phases • Production • Releases • Staging • Features
  64. 64. Project phases • Production • Releases • Staging • Features • Celsadas HotFixes
  65. 65. Common branch names
  66. 66. Common branch names • Everybody has a production branch: master
  67. 67. Common branch names • Everybody has a production branch: master • Release branches: release/*
  68. 68. Common branch names • Everybody has a production branch: master • Release branches: release/* • New features get a branch each: feature/*
  69. 69. Common branch names • Everybody has a production branch: master • Release branches: release/* • New features get a branch each: feature/* • If you have multiple developers on the same feature: feature/NAME/DEV
  70. 70. Common branch names • Everybody has a production branch: master • Release branches: release/* • New features get a branch each: feature/* • If you have multiple developers on the same feature: feature/NAME/DEV • If you need a “next production”: develop
  71. 71. Common branch names • Everybody has a production branch: master • Release branches: release/* • New features get a branch each: feature/* • If you have multiple developers on the same feature: feature/NAME/DEV • If you need a “next production”: develop • When things go wrong: hotfix/*
  72. 72. Conclusions
  73. 73. Conclusions • Git is ready for big teams
  74. 74. Conclusions • Git is ready for big teams • Git is also ready for small teams
  75. 75. Conclusions • Git is ready for big teams • Git is also ready for small teams • There is no right way...
  76. 76. Conclusions • Git is ready for big teams • Git is also ready for small teams • There is no right way... • ... but start with current best practices
  77. 77. Conclusions • Git is ready for big teams • Git is also ready for small teams • There is no right way... • ... but start with current best practices • Whatever you do, the important thing is to use a source control system
  78. 78. Obrigado!
  79. 79. Pedro Melo melo@simplicidade.org @pedromelo Questions about Git, Perl, XMPP, just find me and ask away I’ll be here the three days
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×