nishimura.clubnishimura.club

git

コミットを戻す

git reset --hard <commitId>

リモート上書き

git push -f origin head

コミット間の差分を確認する

git diff $1 $2

checkout 履歴の確認

git --no-pager reflog | awk '$3 == "checkout:" && /moving from/ {print $8}' | uniq | head

Merged なブランチの削除

git branch -D `git branch --merged | grep -v \* | xargs`

PreCommit の回避

git commit -n git cm -n -m "Message"