Open10
忘れがちなgitコマンドをまとめたい

git commit -m
メッセージ付きでコミット

git commit --amend --no-edit
変更を直前のコミットに含める

git fetch origin
git reset --hard origin/main
ローカルをリモートに強制一致させる

git fetch -p
ローカルのリモートブランチ( git branch -a
)をリモートリポジトリと合わせる

git branch | xargs git branch -d
マージ済のローカルブランチを全て削除する

git rebase --continue
rebaseを続行する

git rebase --abort
rebaseを中断する

git stash save 'hoge'
メッセージ付きでstashする

git config --global alias.graph 'log --graph --date-order -C -M --pretty=format:"<%h> %ad [%an] %Cgreen%d%Creset %s" --all --date=short'
git graphコマンドを追加する

git update-index --skip-worktree hote.txt
特定のファイルの変更を無視する
git update-index --no-skip-worktree hote.txt
無視したファイルを元に戻す
git ls-files -v | grep ^s
無視したファイルの一覧を表示する