0

情况如下:

  1. 我之前将代码提交到远程存储库(主版本)
  2. 此后我对本地版本进行了更改,但尚未提交
  3. 我想用版本号标记远程版本,在提交之前将本地(未提交)版本分支并标记为 dev 或类似的东西

我该怎么做呢?

4

1 回答 1

1

只需这样做:

$ 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
于 2013-07-23T15:42:51.750 回答