Git series: Tag the new version after it is online

The following are examples of GitLab.

The new version is online, first push the current branch to the remote server, and then start tagging the current branch

git tag -a tag1.4.7 -m "1.4.7版本代码保存"

Then push to the remote:

git push origin tag1.4.7

After completion, Android Studio still shows the 1.4.7 branch.

If you want to switch to a specific tag, for example, switch to the name "tag1.4.6":

git checkout tag1.4.6

Wait a while for Android stduio to switch.

According to Tag1.4.6, generate a new branch 1.4.6B, and switch to branch 1.4.6B

git branch 1.4.6B tag1.4.6
git checkout 1.4.6B

Let the bullet fly for a while before Android stduio will switch.

If the branch name is wrong, you need to modify the branch name, for example, change v1.4.0 to tag1.4.0

git tag tag1.4.0 v1.4.0
git tag -d v1.4.0
git push origin tag1.4.0

If the branch name conflicts with the tag name, you need to delete the remote tag temporarily, for example, delete v1.4.6

git tag -d v1.4.6
git push origin :refs/tags/v1.4.6

No matter what the name of the deleted tag is, :refs/tags/ is the same. For example, delete tag xx:

git tag -d xx
git push origin :refs/tags/xx

Guess you like

Origin blog.csdn.net/zhangjin1120/article/details/114527314