12. git init
$ git init git-advanced
● creates a repository in ../.git
● interesting: config, hooks, logs, refs
● does a local git checkout
● all state is inside the dir (mv, tar, cp -r, …)
16. git status
$ git status
● “safe” command (always first)
● files/changes NOT yet in index => red
● files/changes in index => green
$ alias gst=’git status’
25. git commit
● what really is it ??
● identified by a recursive sha (long, short 7)
● relative: a DIFF between “parent” and “this”
● absolute: ∅ + Σ (parent) commits
● only 1 parent ? NO (merge, non fast-forward)
28. git remote
● git remote -v
● on server
○ mkdir git-advanved.git
○ cd git-advanced.git
○ git init --bare .
● git remote add origin peter_v@10.1.1.250:
/data/git/git-advanced.git
29. git branch
* git branch -a
* git pull = git fetch + git merge
* git rebase origin/master
* fast forward
30. git ignore
* git ignore in global ~/.git
* cat ~/.gitconfig
* cat ~/.gitignore_global
31. git rebase -i
* git rebase -i
(--continue --abort --skip)
* clean up large binary commits
* git push force
32. git rebase vs. merge
* rebase frequently with /01 /02 branches
* squash (git rebase -i) if needed
* tests can be run locally by developer
(also possible with "git merge master")