LoginSignup
1
1

More than 5 years have passed since last update.

別のrepositoryAでやった全く同じ作業を別のrepositoryBでもやりたい

Posted at

想定

パスが同じ

repositoryA でやった作業を repositoryB でもやりたい

git cd repositoryB
git remote add repositoryA git@example.com:repositoryA.git

repositoryAから持ってきたいcommitを確認する

git log --remotes=repositoryA

↓が対象コミットとする

commit fc355e43ba8963232f71fe2c69b27697bcb36a05

持ってきたいcommitをcherry-pickする(-xをつけることでどっから持ってきたかの追跡可能とする)

git cherry-pick fc355e43ba8963232f71fe2c69b27697bcb36a05 -x

整理すると

  • gitでは別のリポジトリをremote登録することが出来る
  • パスが同じであれば、git-cherry-pickの適用が可能

結論

便利!

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