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でマージ

Last updated at Posted at 2025-04-21
git checkout develop
git checkout -b develop-12345-merge-request

# 次に作業ブランチ(ここではdevelop-12345とします。)に移動してコミットログを確認します。
git checkout develop-12345
git log

# 必要なコミットのidを確認して、新しいブランチでcherry-pickします。
# 「-n」オプション指定の場合は、コミットしない
git checkout develop-12345-merge-request
git cherry-pick -n Aのコミットid Bのコミットid Eのコミットid

# リモートリポジトリに反映
git push origin develop-12345-merge-request

# develop-12345-merge-requestの内容をmasterにマージ
git checkout master
git merge develop-12345-merge-request

以下のような書き方もできる

# Aを含まないEまでのコミットを取り入れる
git cherry-pick AコミットID..EコミットID

# Aを含みEまでのコミットを取り入れる
git cherry-pick AコミットID^..EコミットID
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?