cat .git/HEAD # current branch head
ref: refs/heads/master
cat .git/ORIG_HEAD ; git show | head -1
working tree don't include untracked files
commit
git commit -am "save arezzo files"
git commit --amend
-c, --reedit-message <commit> # reuse and edit message from specified commit
-C, --reuse-message <commit> # reuse message from specified commit
log
git log [<options>] [<revision-range>] [[--] <path>...]
git show [<options>] <object>...
git show [path] # details of last commit log
git log --since=2.weeks
branch and merge
git branch -a # list all
git checkout -b dev # create and checkout a new branch
git checkout master
git merge dev # merge dev into master
--squash create a single commit instead of doing a merge
--abort abort the current in-progress merge
git checkout -- <file> # discard changes in working directory
git reset HEAD~2 # undo 2 changes that haven’t been shared
git reset <paths> # opposite of `git add <paths>`
--soft reset HEAD only
--mixed reset HEAD and index (default)
--hard reset HEAD, index and working tree
--merge reset HEAD, index and working tree
--keep reset HEAD but keep local changes
git revert HEAD~2 # undo 2 changes on a public branch
https://stackoverflow.com/questions/3639342
git reset master
git checkout master
stashing
git stash
git stash list
git stash apply/pop
git stash apply stash@{2}
git stash drop
git stash drop stash@{0}
git config -l
--global ~/.gitconfig
--local .git/config
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
--system /etc/gitconfig
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value [value_regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
git config --global push.default simple
git config --list --show-origin