Download - Collaboration With Git and GitHub
![Page 1: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/1.jpg)
Open Source Collaboration with Git and GitHub
Alec Clews
![Page 2: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/2.jpg)
Credit
• Based on presentation by Nick Quaranto http://xrl.us/benbdq
![Page 3: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/3.jpg)
![Page 4: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/4.jpg)
History
![Page 5: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/5.jpg)
I'm an egoistical bastard, and I name all my projects after myself.
First Linux, now git.
-Linus Torvalds
![Page 6: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/6.jpg)
History
• BitKeeper debacle• Design Goals:
– CVS as an example of what not to do– Distributed workflow– Strong safeguards against corruption– Very high performance
• In development since 2005
![Page 7: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/7.jpg)
![Page 8: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/8.jpg)
And Now
![Page 9: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/9.jpg)
1. Fast
![Page 10: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/10.jpg)
Local
2. Local
![Page 11: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/11.jpg)
The Staging Area
![Page 12: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/12.jpg)
Distributed
3. Distributed
![Page 13: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/13.jpg)
Local vs. Remote
![Page 14: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/14.jpg)
4. Cheap Branching
![Page 15: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/15.jpg)
Branching
![Page 16: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/16.jpg)
Any Workflow
6.Many Workflows
![Page 17: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/17.jpg)
Centralized
![Page 18: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/18.jpg)
Integration Manager
![Page 19: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/19.jpg)
Benevolent Dictator
![Page 20: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/20.jpg)
Failboat.
It’s not perfect.
![Page 21: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/21.jpg)
The downsides
• Complexity• Windows FTL• What's an IDE? (but see egit for Eclipse, plus
Vim and Emacs support, and GUIs)• Still frequent releases
•Cygwin – build yourself•Ubuntu – use Git PPA
![Page 22: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/22.jpg)
![Page 23: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/23.jpg)
![Page 24: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/24.jpg)
Now with git goodness as well
![Page 25: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/25.jpg)
![Page 26: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/26.jpg)
![Page 27: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/27.jpg)
![Page 28: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/28.jpg)
![Page 29: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/29.jpg)
How to Contribute
1. Fork a repository at GitHub 2. Clone and connect your local repository 3. Write tests, implement functionality4. Commit your local changes 5. Push your changes to your fork6. Make a pull request7. Profit!!
![Page 30: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/30.jpg)
Demo
![Page 31: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/31.jpg)
Hints and Tips
• Source git completions file via .bashrc to use git auto complete and branch name in prompt (kudos to Toby)
• Set a global .gitignore filegit config --global \ merge.exludesfiles ~/.gitignore
• Define a couple of global aliases for checkout and branch
![Page 32: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/32.jpg)
Hints and Tips contd
• Use ‘git update-index --stdin’ as part of a pipe to add a lot files or filter files names (c.f. git add)
• Override global settings (e.g. email) in .git/config
• Use ‘git commit --allow-empty’ to perform empty commit (rare corner case)
![Page 33: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/33.jpg)
Example custom merge driver
• Define a new merge driver in .git/config• Define file patterns that use new merge driver• See gitattributes(5)
![Page 34: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/34.jpg)
custom merge driver contd
• In .git/config
[merge "overwrite"]
name = overwrite using cp
driver = cp %B %A
#recursive = defaults to driver
![Page 35: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/35.jpg)
custom merge driver contd
• In .git/info/attributes– NB No space around ‘=‘
* merge=overwrite
![Page 36: Collaboration With Git and GitHub](https://reader033.vdocuments.us/reader033/viewer/2022061218/54b68db44a7959596c8b4575/html5/thumbnails/36.jpg)
git log• http://git-scm.com• http://whygitisbetterthanx.com• http://delicious.com/alecclews/git