Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
あるレポのファイルを/path/to/repoA別のレポのサブディレクトリに移動し、/path/to/repoB/repoA可能であればその履歴を保存する必要がある状況にあります。私が見た唯一の答えは、ローカルリポジトリとリモートリポジトリの間でこれを行い、URLを使用して親リポジトリを識別することでした。
/path/to/repoA
/path/to/repoB/repoA
達成したいこと (つまり、インポートされたリポジトリがどのように動作するか) に応じて、いくつかの異なるオプションを選択できます。Pro Git bookgit subtreeで説明されているように、そのうちの 1 つは を使用しています。
git subtree
cd /path/to/repoB git remote add repoA /path/to/repoA git fetch repoA git read-tree --prefix=repoA/ -u repoA/master git commit -m "import repoA"