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 5 years have passed since last update.

一部分のCommitだけをMergeする(cherry-pick)

0
Posted at

初めに

「特定のコミットだけ反映したいな」と思って調べたのがきっかけです。

cherry-pickとは?

他ブランチの特定コミットのみを反映されることができるコマンドです。

使い方

まずはmergeしたいcommitをlogから探します。

$ git log

commit 84501365f61d8556c67faa0743b8012113b44d51
Merge: a3b2851 21e52cf
Author: 〜
Date:   Fri Dec 28 13:28:01 2018 +0900

    Merge color&size method

commit 21e52cfeb31d1522642db008ddedfed49aa88a5b
Author: 〜
Date:   Fri Dec 28 13:25:17 2018 +0900

その後、cherry-pickします。

$ git cherry-pick 84501365f61d8556c67faa0743b8012113b44d51

以上です。

また、私のメモ書きのようなものなので参考になるかわかりませんが、誰かの為になったら嬉しいです。

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?