rebase first commit

git rebase --root -i

list branchs of a commit

git --git-dir=$GIT_DIR branch --contains $REF -q -r | awk '{ print $1 }' | xargs

name of current branch

git rev-parse --abbrev-ref HEAD

find out if a commit “contains” another commit

git rev-list f5ee3a8 | grep $(git rev-parse b9281ca)

empty pushes

git commit --allow-empty -m "update" && git push aws

update hook

$1: old commit
$2: new commit
$3: symbolic reference

list remote repository

git -c core.askpass=true ls-remote -h git@travis.github.com:phrase/stats.git HEAD

add to last commit

git add
git ci --amend --no-edit

mergetool

dnf install -y meld

github always ssh

# $HOME/.gitignore
[url "git@github.com:"]
insteadOf = https://github.com/ 

force push without overwriting

git push --force-with-lease