Date post: | 11-Jul-2015 |
Category: |
Documents |
Upload: | pedro-melo |
View: | 1,298 times |
Download: | 3 times |
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 offline mode, freedom to tinker)
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
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
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
• No centralized server built-in concept
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
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
Centralized Git Servers
Centralized Git ServersGitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user repo x user x branch x
action
Centralized Git ServersGitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user repo x user x branch x
action
Centralized Git ServersGitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user repo x user x branch x
action
Centralized Git ServersGitosis Gitolite
Managed by git Managed by git + shell
Maintained? Active development
repo x user repo x user x branch x
action
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
• ... and it has Chuck Norris quotes!
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
Rebasefeature
master
Rebasefeature
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_handle>/*
• Think globally to minimize clashes
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 each: feature/*
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
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
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/*
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 with current best practices
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
Obrigado!
Pedro [email protected]
@pedromelo
Questions about Git, Perl, XMPP, just find me and ask away
I’ll be here the three days