Ответ 1
Команды, которые вы описываете, читают поддерево в репозиторий. Команда git-subtree
имеет гораздо больше опций, описанных в документации. Среди прочего вы можете (аннотированный для простоты):
add::
Create the <prefix> subtree by importing its contents
from the given <refspec> or <repository> and remote <refspec>.
merge::
Merge recent changes up to <commit> into the <prefix>
subtree.
pull::
Exactly like 'merge', but parallels 'git pull' in that
it fetches the given commit from the specified remote
repository.
push::
Does a 'split' (see above) using the <prefix> supplied
and then does a 'git push' to push the result to the
repository and refspec. This can be used to push your
subtree to different branches of the remote repository.
split::
Extract a new, synthetic project history from the
history of the <prefix> subtree. The new history
includes only the commits (including merges) that
affected <prefix>, and each of those commits now has the
contents of <prefix> at the root of the project instead
of in a subdirectory. Thus, the newly created history
is suitable for export as a separate git repository.
Существуют также различные флаги, которые помогают и управляют приведенным выше. Я считаю, что все эти варианты были доступны прежде всего с помощью цепей сантехнических команд. git-subtree.sh
просто обертывает их и значительно упрощает их выполнение.