.git
がgitサブツリーである(サブモジュールよりも)方が簡単ですが、これには別のディレクトリも必要です。プロンプトでgit subtree
を入力レポBに
git remote add repoA url.for.A
git subtree add --prefix=examples/ repoA master
作業
は素敵な使用方法の概要を示します。
マージ、プッシュ、プッシュがすべて可能です。厳密には必要ではありませんが、ベスト・プラクティスはであり、サブツリーとメインの間にコミット・スプリットを保持します(コミット・ログが有効であるように、パスexamples/
とコミットを混在させないでください)。 git subtree
からの助けを引用する
:
[TIP]
In order to keep your commit messages clean, we recommend that
people split their commits between the subtrees and the main
project as much as possible. That is, if you make a change that
affects both the library and the main application, commit it in
two pieces. That way, when you split the library commits out
later, their descriptions will still make sense. But if this
isn't important to you, it's not *necessary*. git subtree will
simply leave out the non-library-related parts of the commit
when it splits it out into the subproject later.
ありがとうございます。これは私のために働くかもしれないように見える。先に進む前に、コミットのパスを分けておくことについて詳しく説明してください。私は完全にそれを取得しません。ありがとう! – user3786914
ありがとうございます。それは、必要以上に推奨されるものです。明確化し、参照を追加 – jaimedash