In Git, I created some local tags, and only some of them I wanted to push to origin.
After a while, I want to check what tags were missed from pushing to remote.
do we have command to show all tags which are in the local repo but not pushed to remote repo yet?
Thank you.
Considering a git push
can also push tags, you could use the git push --dry-run
to preview a push and see if tags are pushed or not.
git push --tags --dry-run
That would list the local tags which are not present on the remote.
If the output is empty, all tags are already pushed.
Note that, as mentioned in "How can I see what I am about to push with git?":
The problem with
git push --dry-run
is that it still requires write permission at the remote.
So if you have a clone without permission to push upstream, but you'd like to see what your local unpushed changes are,--dry-run
won't do it.
In that case, the scripting solution mentioned by knittl in the comments (git ls-remote --tags origin
vs. git tag
) is another option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With