collaboration with git and github

Post on 14-Jan-2015

2.251 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

Presentation to Open Source Developers Club Mlebourne. 8/April/09 To be updated for Linux Users of Victoria Nov/09 presentation

TRANSCRIPT

Open Source Collaboration with Git and GitHub

Alec Clews

Credit

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

History

I'm an egoistical bastard, and I name all my projects after myself.

First Linux, now git.

-Linus Torvalds

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

And Now

1. Fast

Local

2. Local

The Staging Area

Distributed

3. Distributed

Local vs. Remote

4. Cheap Branching

Branching

Any Workflow

6.Many Workflows

Centralized

Integration Manager

Benevolent Dictator

Failboat.

It’s not perfect.

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

Now with git goodness as well

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!!

Demo

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

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)

Example custom merge driver

• Define a new merge driver in .git/config• Define file patterns that use new merge driver• See gitattributes(5)

custom merge driver contd

• In .git/config

[merge "overwrite"]

name = overwrite using cp

driver = cp %B %A

#recursive = defaults to driver

custom merge driver contd

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

* merge=overwrite

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

top related