情况如下:
- 我之前将代码提交到远程存储库(主版本)
- 此后我对本地版本进行了更改,但尚未提交
- 我想用版本号标记远程版本,在提交之前将本地(未提交)版本分支并标记为 dev 或类似的东西
我该怎么做呢?
情况如下:
我该怎么做呢?
只需这样做:
$ git status .
[...]
# modified: README.txt
[...]
# the following will create a tag on the last commit
# (the one already pushed to the remote)
$ git tag -a "v0.12" -m "version 0.12"
# send the tag to the remote
$ git push --tags
# create a new branch 'dev' and immediately switch to it
$ git checkout -b "dev"
# commit the modified files to the new branch
$ git commit -m "updated README for new 'dev'-version" README.txt
# push the new branch to the remote
$ git push