1

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.

TN.
  • 18,874
  • 30
  • 99
  • 157

1 Answers1

0

I'm not sure it's possible. Git docs says:

By default, the git push command doesn’t transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them.

george007
  • 609
  • 1
  • 7
  • 18