We can push a subtree (In this example to doc
folder) to gh-pages
like this:
git subtree push --prefix doc origin gh-pages
If we wanted the content of the doc
folder to be pushed to an api
folder under gh-pages
is it possible to specify an api
folder as part of the push?
Or do would need to move the content of the doc
folder to doc/api
and then push doc
? That would have the same desired effect ...
move the content of the
doc
folder todoc/api
and then pushdoc
?
Yes, that's the only way. git subtree push
doesn't do any magic, it just splits (using git subtree split
) a separate branch and does git push
. As git push
cannot push into a subdirectory then git subtree push
cannot do either.