Git Class Cheat Sheet
Git Class Cheat Sheet
Documentation (http://progit.org/book/)
git help [cmd]
Managing Remotes
Clone: List: Send: Recv: Add: Fetch: Checkout: git git git git git git git git git clone url remote -v push push origin master pull pull origin master remote add name url fetch name checkout name/master
3 Principles
1. (Almost) everything is local 2. Git commits are snapshots 3. Branching is cheap, use it often
Next Steps
git tag name git rebase commit git cherry-pick commit git bisect git-svn hooks tracking branches submodules interactive staging squashing commits repository hosting patches via email gitjour
Getting Started
Setup Install: Name: Email: sudo port install git-core +svn git config global user.name \ "Nate Murray" git config global user.email \ "[email protected]"
First Repo cd mkdir -p projects/demo cd projects/demo git init git status ls -a echo "version 1" > test.txt git status git add test.txt git status git commit -m "added version one" git status Aliases st: git config global alias.st status ci: git config global alias.ci commit ca: git config global alias.ca commit -a
$Revision: 1.1, $Date: August 31, 2010 Nate Murray ([email protected]) See also: http://book.git-scm.com/ http://git.or.cz/course/svn.html Based on Steve Taylons Clojure Cheat Sheet
GUI
Commits: Merge: gitx git mergetool -t opendiff
Internals
View Log: Show: Cat: git log git show a8dn3 # sha git cat-file -p 9s2j # sha