LoginSignup
0
1

More than 3 years have passed since last update.

git プルリクしたあと不要なコミットを削除したい

Posted at

プルリクしたあと、不要なコミットを削除したい

※必ず実行したいブランチにいることを確認する
「方法1」履歴が残らない

・git reset --hard HEAD^
・コードを修正する
・git add と git commit をする
・git push -f origin {リモートブランチ名}

「方法2」履歴が残る

・git revert {コミットID}
・コードを修正する
・git add と git commit をする
・git push -f origin {リモートブランチ名}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1