Open5
便利なGitコマンド集
リモートで消されたブランチを自動的に削除 --prune
git fetch --prune
短縮形
git fetch -p
コミットメッセージを変更 --amend
git commit --amend -m "message"
リモートの変更を取り込む際のstashとstash pop を自動化する --autostash
git pull --autostash
rebase する時も同様
git rebase --autostash
--autostashをデフォルトにしたい時
.gitconfig
# pull
git config --global pull.autostash true
# rebase
git config --global rebase.autoStash true
--autostashをデフォルトにしたけど、--autostashしたくない時
.gitignore
# pull
git pull --no-autostash
# rebase
git rebase --no-autostash
プルリクエストを一瞬で手元に持ってくる(GitHub CLI)
PR一覧を見る
gh pr list
該当のPRをローカルに持ってくる
gh pr checkout <Request番号>
短縮系
gh co <Request番号>