I'm migrating some versions of a project manually into git, so I have done the following:
git add .git commit -m "xxx"git tag -a "Vx.x.x" -m "xxx"Then I repeated the above for all my versions and when I had finished all versions I ran: git push --tags
when I checked the server all tags were there with all files and full history, but master was still the same empty project with just the readme.md file, and on checking git status it said I was 6 versions behind.
So I ran git push and it was ok after that.
Did I do something wrong in my steps as I presumed after each commit master would be updated and push with --tags would push everything.
thanks.
From comment: As per the documentation: --tags: "All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line." - If you didn't explicitly mention any refspecs, git push --tags pushes only tags. It will push enough commits to be able to store the tags, but it will not update remote branches.
You can automate it via: Push git commits & tags simultaneously
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