Top Banner
Open Source Collaboration with Git and GitHub Alec Clews
36

Collaboration With Git and GitHub

Jan 14, 2015

Download

Technology

Alec Clews

Presentation to Open Source Developers Club Mlebourne. 8/April/09

To be updated for Linux Users of Victoria Nov/09 presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Collaboration With Git and GitHub

Open Source Collaboration with Git and GitHub

Alec Clews

Page 2: Collaboration With Git and GitHub

Credit

• Based on presentation by Nick Quaranto http://xrl.us/benbdq

Page 3: Collaboration With Git and GitHub
Page 4: Collaboration With Git and GitHub

History

Page 5: Collaboration With Git and GitHub

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

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
Page 8: Collaboration With Git and GitHub

And Now

Page 9: Collaboration With Git and GitHub

1. Fast

Page 10: Collaboration With Git and GitHub

Local

2. Local

Page 11: Collaboration With Git and GitHub

The Staging Area

Page 12: Collaboration With Git and GitHub

Distributed

3. Distributed

Page 13: Collaboration With Git and GitHub

Local vs. Remote

Page 14: Collaboration With Git and GitHub

4. Cheap Branching

Page 15: Collaboration With Git and GitHub

Branching

Page 16: Collaboration With Git and GitHub

Any Workflow

6.Many Workflows

Page 17: Collaboration With Git and GitHub

Centralized

Page 18: Collaboration With Git and GitHub

Integration Manager

Page 19: Collaboration With Git and GitHub

Benevolent Dictator

Page 20: Collaboration With Git and GitHub

Failboat.

It’s not perfect.

Page 21: Collaboration With Git and GitHub

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
Page 23: Collaboration With Git and GitHub
Page 24: Collaboration With Git and GitHub

Now with git goodness as well

Page 25: Collaboration With Git and GitHub
Page 26: Collaboration With Git and GitHub
Page 27: Collaboration With Git and GitHub
Page 28: Collaboration With Git and GitHub
Page 29: Collaboration With Git and GitHub

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

Demo

Page 31: Collaboration With Git and GitHub

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

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

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

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

custom merge driver contd

• In .git/info/attributes– NB No space around ‘=‘

* merge=overwrite

Page 36: Collaboration With Git and GitHub

git log• http://git-scm.com• http://whygitisbetterthanx.com• http://delicious.com/alecclews/git