タグ

ブックマーク / qiita.com/uasi (1)

  • Git で複数のリポジトリをまとめたり、逆に切り出したりする - Qiita

    ~/repo1/subdir に ~/repo2 を入れる あるリポジトリのサブディレクトリに別のリポジトリの中身を入れたいとき。たとえば、あるリポジトリのサブディレクトリを切り出して別のリポジトリとして管理しているものを、元のリポジトリに合流させたいとき。 cd ~/repo1 git remote add repo2 ~/repo2 git fetch repo2 # サブディレクトリの内容に repo2 の内容をマージする # (repo2 と内容が似ているサブディレクトリを自動で判別) git merge -s subtree repo2/master # ↑でうまくいかないときにはパスを指定する↓ git merge -X subtree=subdir repo2/master # そもそも ~/repo1/subdir が存在しないときには↓ git read-tree --p

    Git で複数のリポジトリをまとめたり、逆に切り出したりする - Qiita
  • 1