0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

mergeコミットごとコミットを全部rebaseで1つにまとめた後にpushして、PRのfiles changedにmergeコミットの分まで含まれてしまった時の対処法

Posted at

あくまで自分用のメモなのでわかりにくいのはご了承ください。

ブランチはhoge_branchとして、rebaseでコミットが1つにまとまっている状態で

$ git reset head^
$ git stash -u
$ git checkout develop
$ git pull origin develop
$ git checkout -b copy-hoge_branch
$ git stash apply
$ git add .
$ git commit -m "xxx"
$ git push -f origin copy-hoge_branch:hoge_branch

もしこの手順でやってfiles changedは正しくなったけどPRのコミットが1つにまとまってなかったら、この手順をもう1回やればコミットは1つにまとまるはず

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?