您描述的命令将子树读入存储库。 git-subtree命令还有更多选项,如the documentation.所述,您可以(为简单起见注释):
add::
Create the subtree by importing its contents
from the given or and remote .
merge::
Merge recent changes up to into the
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 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 subtree. The new history
includes only the commits (including merges) that
affected , and each of those commits now has the
contents of 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只是包装它们并使它们更容易执行。