How to push a subtree towards a hero using a non-leading branch

I know I can do this:

git subtree push --prefix server heroku master 

click on the subtree of my project (in this case, everything is in the. / server directory).

And I can do the following to push the non-leading branch:

 git push heroku somebranch:master 

But I can’t imagine any combination that looks like to push a non-master-subtree:

 git subtree push --prefix server heroku somebranch:master 

I get:

 'somebranch:master' does not look like a ref 

I would love to do that!

+5
source share
1 answer

On my machine running on Git 2.7.1, the documentation for git subtree push says

Does it provide split (see below) with <prefix> and then does git push to dump the result to the repository and ref. This can be used to push your subtree into different branches of the remote repository.

There is no mention of branches in the documentation for git subtree , and none of the cases where branches are mentioned are suitable for your use.

Reading between lines that look like a source branch is all you checked:

 git checkout somebranch git subtree push --prefix server heroku master 

And indeed, you have confirmed in the comments that this works.

+3
source

Source: https://habr.com/ru/post/1243614/


All Articles