ローカルのmasterのHEADをoriginのHEADにあわせる
普通はrebaseやmerge --ff-onlyなのだがたまに現在のcheckoutしたファイルをそのままにHEADを別のcommit IDに変更したいときがある。
git update-ref
git show-ref --abbrev # bbbbbbb refs/heads/master # aaaaaaa refs/remotes/origin/master git update-ref -m "Update master ref to origin" refs/{heads,remotes/origin}/master git show-ref --abbrev # aaaaaaa refs/heads/master # aaaaaaa refs/remotes/origin/master
-mオプションは省略可能。メッセージはローカルのreflogに記録される。