Getting Started with Git

Version 194.1 by Kieran Kelleher on 2011/04/29 12:14

Got Git? If not, Get Git here

Just pick the latest release for your Mac architecture here:
OS X dmg Installer

Learning About git

Start here:

Have a Good Laugh here as Linus Torvalds Evangelizes git:
this is more fun than learning, but gives you insight into the motivation behind git

Learn the basics here:

Get the Detailed Reference Materials Here:

Git Cheat Sheets

Checkout (Clone) Wonder Source Code, Build and Install

Git Goodies

Git Bash Completion

This is really an absolute necessity and a huge productivity improvement. Basically you need the bash completion script from the source tarball and use your shell profile to include it whenever you open a shell. See the Auto-Completion section on this page:
Git Bash Auto-Completion

GitX git GUI

GitX is an awesome FREE history viewer made for OS X. It is a better way to visualize your branch and commit history of your git repository. However, power users (aka "cool kids") will probably only use it for history viewing while they continue to use the terminal command line for checkouts, branching, staging, rebasing and committing.
GitX Home Page

Open in GitX

Open In GitX Finder Droplet

Git Tower

For those of you who just get panic attacks at the thought of using the Terminal, there is a commercial app for that:
Git Tower

I use Tower (bought it), but only for committing and fixing merge conflicts. I think Tower misses quite a bit of the flagship feature of GIT: branches. You can't see a branch tree graphically, like you can with gitX or even the command line (git log -graph -color, IIRC). But it's cool for committing. For everything else I use command line.
 Miguel Arroz

Using git locally on a Subversion Working Copy

OK, so you are addicted to git, and now you have to work on a team project that is hosted in a remote subversion repository ... and it is making you depressed :-( . Well, you can use manage your local svn working copy using git and be happy again

I recommend you just use the git+svn protocol.

Git Concepts

Rebasing

Rebasing is unique to git. There is no counterpart in Subversion.

Rebasing cuts down on the spaghetti history of merging and helps to keep history nice and linear.

Conceptually, when I rebase my current branch A on another branch B, git removes all my branch A commits back to the common ancestor of A and B, stashes those commits away temporarily, moves the head of the current branch A to the tip of the other branch B, and then re-applys all my stashed commits as new commit patches to my branch B.

However before using it on work that is shared with others you MUST follow the these rules, otherwise you will screw everyone else on the project.

  • If you don't understand rebasing, don't use it!
  • Use rebase on private branches
  • Use rebase for commits that have not been pushed to a remote repo

http://progit.org/book/ch3-6.html
http://www.eecs.harvard.edu/~cduan/technical/git/git-5.shtml
http://book.git-scm.com/4_rebasing.html
http://blip.tv/file/4094727