LoginSignup
22
23

More than 5 years have passed since last update.

Gitで別リポジトリの特定コミットを取り込む方法

Posted at

Gitって便利すぎだなー。

取り込みたいリポジトリを、remoteに加えてfetchします。

$ git remote add hoge git@bitbucket.org:hoge/hoge.git
$ git fetch hoge

取り込みたいコミットをcherry-pickします。

$ git cherry-pick [取り込みたいコミットのhash値]

これでコミットが取り込まれます。ログには取り込んだコミットの、コミット時のコメントもそのまま反映されます。

取り込み完了したら、remoteから削除します。

$ git remote rm hoge
22
23
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
22
23