Yet another git cheat sheet!

Everyone else seems to have blogged about their favorite git features, so I might as well do the same… AND I don’t want to forget these items, so:

Setting up a bare repository for shared use:

git init -bare --shared=group foo.git

Pushing the first commit to a new remote:

git push -u origin master

gitolite is cool.  Here’s a cheat: http://wiki.dreamhost.com/Gitolite

To push local tags back to the origin:

git push --tags

and to push branches:

git push origin BRANCHNAME

Stash!

git stash  # simple
git stash pop  # unwind
git stash save "comment"  # like stash with a comment/name
git stash list # where are we in stashes

rev-parse

git rev-parse master # give me the UUID for the named patch

Create a new SVN branch from git svn. see: http://stackoverflow.com/questions/266395/git-svn-how-do-i-create-a-new-svn-branch-via-git

$ git svn branch -n -m "This is my new branch" bug23
$ git checkout -b local/bug23

Another neat tool is Gource, an animated OpenGL-based visualization of your git (or other) repository.

Deal with line endings:

https://help.github.com/articles/dealing-with-line-endings