I would like to push a commit with a particular tag (T) to a branch (B).
I am using the following command:
git push origin refs/tags/T:refs/heads/B
The command fails with
! [remote rejected] T -> B (failed to write) error: failed to push some refs to 'origin'
NOTE: There is not branch B in the remote origin.
NOTE2: When I use git push origin T:B
, it creates a tag B on the remote.
NOTE3: When I use `git push origin 45feef5:B, it works. However I would like to use tag name instead of the commit hash.