Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1098237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:33:00+00:00 2026-05-17T00:33:00+00:00

git push –tags is a separate operation to git push since pushing tags should

  • 0

git push --tags is a separate operation to git push since pushing tags should be a conscious choice to avoid accidentally pushing the wrong one. That’s fine. But how do I push them both simultaneously / atomically? (git push && git push --tags is not perfectly atomic.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:33:01+00:00Added an answer on May 17, 2026 at 12:33 am

    Update August 2020

    As mentioned originally in this answer by SoBeRich, and in my own answer, as of git 2.4.x

    git push --atomic origin <branch name> <tag>
    

    (Note: this actually work with HTTPS only with Git 2.24)

    Update May 2015

    As of git 2.4.1, you can do

    git config --global push.followTags true
    

    If set to true enable –follow-tags option by default.
    You may override this configuration at time of push by specifying –no-follow-tags.

    As noted in this thread by Matt Rogers answering Wes Hurd:

    --follow-tags only pushes annotated tags.

    git tag -a -m "I'm an annotation" <tagname>
    

    That would be pushed (as opposed to git tag <tagname>, a lightweight tag, which would not be pushed, as I mentioned here)

    Update April 2013

    Since git 1.8.3 (April 22d, 2013), you no longer have to do 2 commands to push branches, and then to push tags:

    The new "--follow-tags" option tells "git push" to push relevant annotated tags when pushing branches out.

    You can now try, when pushing new commits:

    git push --follow-tags
    

    That won’t push all the local tags though, only the one referenced by commits which are pushed with the git push.

    Git 2.4.1+ (Q2 2015) will introduce the option push.followTags: see "How to make “git push” include tags within a branch?".

    Original answer, September 2010

    The nuclear option would be git push --mirror, which will push all refs under refs/.

    You can also push just one tag with your current branch commit:

    git push origin : v1.0.0 
    

    You can combine the --tags option with a refspec like:

    git push origin --tags :
    

    (since --tags means: All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line)


    You also have this entry "Pushing branches and tags with a single "git push" invocation"

    A handy tip was just posted to the Git mailing list by Zoltán Füzesi:

    I use .git/config to solve this:

    [remote "origin"]
        url = ...
        fetch = +refs/heads/*:refs/remotes/origin/*
        push = +refs/heads/*
        push = +refs/tags/*
    

    With these lines added git push origin will upload all your branches and tags. If you want to upload only some of them, you can enumerate them.

    Haven’t tried it myself yet, but it looks like it might be useful until some other way of pushing branches and tags at the same time is added to git push.
    On the other hand, I don’t mind typing:

    $ git push && git push --tags
    

    Beware, as commented by Aseem Kishore

    push = +refs/heads/* will force-pushes all your branches.

    This bit me just now, so FYI.


    René Scheibe adds this interesting comment:

    The --follow-tags parameter is misleading as only tags under .git/refs/tags are considered.
    If git gc is run, tags are moved from .git/refs/tags to .git/packed-refs. Afterwards git push --follow-tags ... does not work as expected anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have git pull and git push in one git command?
After pushing to a git repo, I got this error: [trusktr@starlancer bml]$ git push
I'm using Git 1.7.4.1. I want to push commits I did on one folder
all questions I found want to avoid timeouts in git push/pull. In my case
What would possibly cause a 'git push' to try and commit to two branches?
I recently switched to upstream for my git push configuration (meaning only the current
I just squashed some commits with git rebase and did a git push --force
I've already looked at questions git rebase and git push: non-fast forward, why use?
Is it possible to automatically encrypt files via 'git push' before transferring to a
The command to remove a remote branch in git is the following git push

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.