When adding tags to a certain commit in git local repository, it might be important to push the tags and commits to remote repository simultaneously to ensure CI/CD pipeline is triggered correctly. For example, if build pipeline has steps that are created with custom condition which is based on tag patterns. For this scenario, you may not want to trigger the pipeline until the tag is pushed.
To push tags and commits simultaneously, you will need to use different commands in different version.
From git 2.4
Since Git 2.4, we can use the following command to push tags and commits at the same time:
git push --atomic origin <branch name> <tag>
For example, the following command push the commits to origin master branch together with tag reference tag-name.
git push --atomic origin master tag-name