Git installation
Repository initialization
Commit
Add, stage, remove and move files
Show diff
http://code.google.com/p/git-osx-installer
...or via MacPorts
$ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com
$ git config --global core.editor nano
$ git config --global color.ui true
ALIAS
Add your favorite aliases to the .gitconfig file located in your home folder
[alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short type = cat-file -t dump = cat-file -p
AUTO-Completion
To enable git commands auto-completion in the bash shell download git-completion.bash to
/opt/local/etc/bash_completion.d (MAC)
/etc/bash_completion.d/ (LINUX)
$ git init
After the commit (if all the modification has been commmitted) the repository is again in a clean state
$ git rm --cached file.py
Git tracks content, not files. Although there is a move command...
$ git mv file1 file2
...this is the same as...
$ mv file1 file2
$ git rm file1
$ git add file2
$ git commit --amend
$ git reset HEAD file.py
$ git checkout -- file.py
Git doesn't delete commits