How do you push a Git tag to a branch using a refspec?

Michael van Rooijen picture Michael van Rooijen · Oct 31, 2010 · Viewed 135.2k times · Source

I want to force push, for example, my tag 1.0.0 to my remote master branch.

I'm now doing the following:

git push production +1.0.0:master

I want to force the push, because all I care about is that the code inside the 1.0.0 tag is pushed to the master branch on the remote repository.

What am I doing wrong?

Update #1

When I SSH into my server where my Git repository is and execute git branch -l, I don't see the master branch listed either.

Update #2

After running git tag -l from inside the remote Git repository, I see that master is listed, meaning that when I ran the following:

git push production 1.0.0:master

It actually pushed the tag and created a tag named master rather than a new branch.

I want to basically push the contents of the tag 1.0.0 into the master branch of the remote Git repository.

Answer

bstpierre picture bstpierre · Oct 31, 2010
git push --tags production