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?

既にcherry-pickで取り込まれているコミットを再度cherry-pickしたい場合

Posted at

GitLab Web UIでrevert→再cherry-pick

内容の変化には注意

revert した時点で差分がなくなる可能性があるため、再cherry-pickしても「差分が無い」と判断されて、何も起きないことも。

Web UIでは revert → cherry-pick も制限される可能性あり

GitLabのWeb UIは裏でGitのcherry-pickコマンドを走らせているので、revertしても内部的に「内容が同じ」と判断されて弾かれることもあります(バージョンや設定次第)。

CLIで--keep-redundant-commitsオプション使用

確実に可能
Gitバージョン2.30以上推奨

git checkout target-branch
git cherry-pick -x --keep-redundant-commits <commit-id>
git push origin target-branch

コミット内容を手動で再コミット

確実に可能
履歴的には別コミット扱い

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?