Better Git: git fetch not getting tags

I just ran into a little gotcha with regard how fetch handles tags. When it pulls down commits, you will usually see that it also pulls down tags. I was a little confused today when fetch was refusing to pull a tag that was clearly in the repository (“git ls-remote --tags“) lets you see tags available on the remote).

I kept running the fetch command but the tag wouldn’t get pulled down. The reason has to do with the way fetch works, it only fetches tags that are direct references to a commit that is in a branch being fetched. To get all tags regardless of what commits they reference use the fetch in the following way.

From the git manual (“git help fetch”):

-t, –tags Most of the tags are fetched automatically as branch heads are downloaded, but tags that do not point at objects reachable from the branch heads that are being tracked will not be fetched by this mechanism. This flag lets all tags and their associated objects be downloaded. The default behavior for a remote may be specified with the remote.<name>.tagopt setting. See git-config(1).

This will effectively do the inverse of normal fetch. It will fetch all tags, and bring with is any necessary commits.

Hope this helps some poor confused folks out there a little bit of greif.

About these ads

32 Comments on “Better Git: git fetch not getting tags”

  1. Excellent goods from you, man. I have understand your stuff previous to and you
    are just too fantastic. I actually like what you have acquired here,
    really like what you are saying and the way in which you say it.

    You make it entertaining and you still take care
    of to keep it smart. I can’t wait to read far more
    from you. This is actually a wonderful web site.

  2. In general, it will usually cost over $50000 for a heavy-duty, used
    tow truck. When it comes to accessories like this, the old
    advice “you get what you pay for” applies. Though a frontal collision between two
    vehicles has been identified as perhaps the most serious cause of fatalities in driver-to-driver collisions, in regards to
    the passenger, a side impact collision could be more dangerous.

  3. Hi to every , as I am actually eager of reading this weblog’s
    post tto be updated onn a regular basis. It arries nice stuff.

  4. A variety of cool game titles now are out there foor alll ages,
    with functions that remarkably make fascinating adventures near to
    actuality. The games promote sensible movement scenes thanks too their effectively-designed graphics
    and designs.

  5. It’s really very difficult in this active life to listen news on Television, thus
    I only use inrernet for that purpose, and
    obtain the newest news.

  6. Wow that was strange. I just wrote an incredibly long comment but
    after I clicked submit my comjent didn’t show up.
    Grrrr… well I’m not writing all that over again. Anyways,
    just wwanted to say excellent blog!

  7. No Sick Fish says:

    Yοur style is really unique inn comparison to other ƿeople I have read stff from.
    Thanks for posting when you have the opportսnity, Guess I’ll just booƙ mark this web site.

  8. Definitely believe that that you stated. Your favorite justification seemed to be
    at the internet the simplest thing to bear in mind of. I say to
    you, I certainly get annoyed even as folks think about worries that they just do not
    recognize about. You managed to hit the nail upon the top as well
    as outlined out the whole thing without having side effect , other folks could take a signal.

    Will probably be again to get more. Thank you

  9. Hi there to every body, it’s my first pay a quick visit
    of this web site; this blog includes amazing and really fine information designed for
    visitors.

  10. It’s a shame you don’t have a donate button! I’d certainly
    donate to this excellent blog! I guess for now i’ll
    settle for book-marking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will share this site with my Facebook group.
    Talk soon!

  11. ache says:

    WOW just wha ӏ was searching for. Camе here by searching
    forr service chɑrge

  12. Greetings! I know this is kinda ooff topic nevertheless I’d figured
    I’d ask. Would yoou bbe interested in exchanging links oor maybe guest writing a blog article or vice-versa?

    My site addresses a llot of the same topics as yours annd I think we could greatly benefit from each other.
    If you might be interested feel free to sesnd me an email.
    I look forward to hearing freom you! Awesome blog by the
    way!

  13. Clay says:

    ” “What’s the best escape from a kumara. The
    Legends Community is the transcendent instrument for all web ad.
    While these sort of applications help lower tier
    players improve, they can really complicate higher level of play where every inch
    turns into a mile.

  14. babysitter says:

    Asking questions are in fact pleasant thing if you are not understanding anything totally, except
    this piece of writing presents good understanding yet.

  15. visitor says:

    Thanks , I’ve recently been looking for info about this topic
    for ages and yours is the best I’ve came upon till now. However, what
    about the conclusion? Are you sure in regards to the source?

  16. My brother recommended I would possibly like this website.
    He used to be totally right. This put up truly made my day.
    You can not imagine just how so much time I had spent for this info!

    Thank you!

  17. Prior to March 2009, Hotmail text messages could only
    be delivered and received through Microsoft Outlook or through Windows Live’s website.

  18. Appreciation to my father who shared with me
    concerning this weblog, this weblog is really amazing.

  19. Everything is very open with a really clear description of the challenges.
    It was definitely informative. Your site is very useful.
    Thank you for sharing!

  20. Abdul says:

    Ne pas payer avec de l’argent réel pour votre amusement plus longtemps, de profiter de cette incroyable Equideow Hack d’obtenir
    tout dans le jeu gratuitement.

  21. I needed to thank you forr this excellent read!!I certainly enjoyed every little bit of it.
    I have got you bookmarked to check out new stuff you post…

  22. alienism says:

    You will need to notice that even the best auto insurance firms calculate rates
    otherwise, which is why a car insurance quote comparison will yield various premiums.

  23. Vouchera says:

    What’s up, this weekend is nice for me, for the reason that this point in time i am reading
    this impressive informative post here at my home.

  24. war commander hack says:

    Fine way of telling, and good post to get data about my
    presentation topic, which i am going to convey in university.

  25. Hey there! Do you use Twitter? I’d like to follow you if that would
    be okay. I’m definitely enjoying your blog and look forward to new posts.

  26. You are so interesting! I do not think I’ve read through anything like that
    before. So wonderful to discover somebody with genuine thoughts on this
    issue. Seriously.. many thanks for starting this
    up. This website is something that’s needed oon the internet, someone with a little originality!

  27. It’s impressive that you are getting thoughts from this paragraph as well as from our argument made at this time.

  28. Howdy! Do you know if they make any plugins
    to assist with SEO? I’m trying to get my blog
    to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Cheers!

  29. hello!,I like your writing very so much! proportion we be in contact more approximately your post on AOL?

    I need a specialist in this house to unravel my problem.

    Maybe that is you! Taking a look forward to peer you.

  30. Thankѕ for finally talking about >Better Git: git fetcɦ not getting tags | eddiemoyа <Liked it!

  31. Sherlene says:

    Especially when you are able to keep users playing against tank ball each other.
    Games on the screen. With a virtual universe can be exceptionally alluring for kids to enjoy racing
    games have certain twists and turns and runs. For example, in real time
    strategy set in mythological China. The developers,
    there’s actually no harm in having some entertainment which makes
    it that are bouncing and flying around.

  32. tutaj says:

    Hello there, I think your website could possibly be having browser compatibility problems.
    Whenever I look at your website in Safari, it looks fine but
    when opening in I.E., it’s got some overlapping issues.
    I just wanted to provide you with a quick heads up!
    Besides that, great website!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 254 other followers