Practical Git

Introduction
Environments
References
Recipes
Distributed Revision Control System
Snapshots vs Differences


WORKING TREE
INDEX
REPOSITORY
git add
git commit
git reset
git checkout
HEAD - Current Position
{pointer}^{n} - n-th parent
{pointer}~{n} - n-th ancestor
Master | HEAD
origin / develop
origin / develop ^ 2
HEAD~
origin / develop ^ ^

.gitconfig
.gitignore
### Mac Shit ###
.DS_Store
Thumbs.db
### Vim Shit ###
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~Ignore only for yourself (local repository)
git config --local core.excludesfile=/path/to/.gitignoreGlobally ignore system / editor files
or, add explicitly in .git/info/excludes
git config --global core.excludesfile=/path/to/.gitignoretemporary ignore files
git update-index --assume-unchanged patate.pursgit update-index --no-assume-unchanged patate.purs[alias]
ls-ignored = !git ls-files -v $(git rev-parse --show-toplevel) | grep '^[[:lower:]]'change messages of a bunch of commits
git filter-branch --msg-filter 'echo "v14 | $(cat)"' <branch>...<REF_LIMIT>change the last commit
git add patate.hs
git commit --amend -m "omelette du fromage"
git add patate.elm
git commit --amend -C HEADshow all commits related to a file
git log --follow patate.exsNow.
Push Code.

deck
By Matthias Benkort
deck
- 126