23
23

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.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?