LINUX.ORG.RU

История изменений

Исправление Jurik_Phys, (текущая версия) :

Судя по всему git-subtree должно помочь.

# move yourself to the subtree commit of your choice
git checkout <subtree-hash>

# fetch commits from the subtree repository, to have available the commit you want
# to cherry pick.
git fetch <path-to-remote>

# cherry pick the hash you want
git cherry-pick <cherry-hash>

# move back to your original branch
git checkout <your-branch>

# subtree merge your cherry pick (using the previous HEAD),
# so that it gets moved to the correct location specified by prefix.
git subtree merge --prefix <subtree-prefix> HEAD@{1}

# Since you probably fetched more commits that you needed from
# the remote, you might want to clean those that where not needed
git gc

Но, я так понял, что с подпроектами идеологически правильно работать в режиме read-only, а необходимые изменения сначала вносить в удалённый репозиторий подпроекта, а затем pull'ить и merge'ить их в основной проект.

Опыта мало, остановлюсь на последнем, git-subtree оставлю в закладках.

Исходная версия Jurik_Phys, :

Судя по всему git-subtree должно помочь.

# move yourself to the subtree commit of your choice
git checkout <subtree-hash>

# fetch commits from the subtree repository, to have available the commit you want
# to cherry pick.
git fetch <path-to-remote>

# cherry pick the hash you want
git cherry-pick <cherry-hash>

# move back to your original branch
git checkout <your-branch>

# subtree merge your cherry pick (using the previous HEAD),
# so that it gets moved to the correct location specified by prefix.
git subtree merge --prefix <subtree-prefix> HEAD@{1}

# Since you probably fetched more commits that you needed from
# the remote, you might want to clean those that where not needed
git gc

Но, я так понял, что с подпроектами идеологически правильно работать в режиме read-only, а необходимые изменения снача вносить в удалённый репозиторий подпроекта, а затем pull'ить и merge'ить их в основной проект.

Опыта мало, остановлюсь на последнем, git-subtree оставлю в закладках.