0

I just created an annotated tag on machine A, then pushed the tag to the server S:

@A$ git tag -a v1 -m"Release version 1"
@A$ git push origin_on_S v1

Then on machine B, I tried to fetch the tag:

@B$ git fetch origin v1

I got the commit, but not the tag. The reply from fetch was:

From <server_S/repo>
 * tag               v1 -> FETCH_HEAD

Then nothing. FETCH_HEAD was updated, but apparently no annotated tag was created.

I am currently trying git fetch origin v1:v1, but I had the impression that git fetch tag should fetch both the data and the annotated tag. Was I wrong, or did I do something wrong to prevent this?

Gauthier
  • 40,309
  • 11
  • 63
  • 97
  • possible duplicate of [Push a tag to a remote repository using Git?](http://stackoverflow.com/questions/5195859/push-a-tag-to-a-remote-repository-using-git) – jub0bs Jun 17 '15 at 15:19
  • @Jububs - I think his push is actually OK, and it is the fetch that is the problem here. Not sure if you can fetch a single tag to something other than FETCH_HEAD. – Andrew C Jun 17 '15 at 17:28
  • @jububs : @Andrew C is correct. I could finally get the fetch to work, with the `:`, but I'm not sure. I need to build a simple test case to demonstrate this. – Gauthier Jun 17 '15 at 19:58

1 Answers1

3

You need to do it like

git push --tags
JSelser
  • 3,510
  • 1
  • 19
  • 40