Git push origin <tagname> 不反映最新推送
Git push origin <tagname> doesn't reflect the latest push
我知道有很多内容可用于此,但其中 none 给了我最想要的内容。
我想将我的最新提交推送到 Git Repo
上的 新创建的标签 。我提到了这个:
- Git Basics Tagging
- Push commit and tags simultaneously
- Push the commit to an existing tag
现在,读完之后,我知道,我需要的是git push origin <tagname>
。在那之前,我做了
$ git <tagname>
$ git show <tagname>
他们都向我展示了正确的结果,这给了我一个绿色信号去执行最终命令。
$ git add .
$ git commit -am "My message"
$ git push origin <tagname>
现在,当我 git push origin <tagname>
时,我得到了这个 Everything up-to-date
。我看到了我的 GIT Repo
,没有任何东西被推送。在查看了一些答案之后,我终于找到了部分对我有用的东西,那就是
$ git push origin : <tagname>
这确实将我的数据推送到了存储库,但是当我检查我的 Tag
时,它并没有反映在其中,它只显示了我的最后一次提交,而不是当前的,我刚才推的。我该怎么做,才能成功将我的数据推送到特定标签?
您似乎没有标记要标记的提交,而是标记了之前的提交 - 首先您创建了一个标记,然后提交了新的更改。 git show <tagname>
是否显示正确的提交?
A tag
不会通过 git commit
.
等操作进行更新
从您的问题中提取步骤并编号:
1. git tag <tagname>
2. git show <tagname>
3. git add .
4. git commit -am "My message"
5. git push origin <tagname>
步骤 4.
的提交移动了您的活动 分支 ,它没有更新步骤 标签 创建的1.
.
如果您再次输入 git show <tagname>
,标签仍会位于其起始位置。
如果你想在本地更新标签,你必须 运行 :
git tag --force <tagname>
如果你想将该标签另外推送到源:
git push origin --force <tagname>
我知道有很多内容可用于此,但其中 none 给了我最想要的内容。
我想将我的最新提交推送到 Git Repo
上的 新创建的标签 。我提到了这个:
- Git Basics Tagging
- Push commit and tags simultaneously
- Push the commit to an existing tag
现在,读完之后,我知道,我需要的是git push origin <tagname>
。在那之前,我做了
$ git <tagname>
$ git show <tagname>
他们都向我展示了正确的结果,这给了我一个绿色信号去执行最终命令。
$ git add .
$ git commit -am "My message"
$ git push origin <tagname>
现在,当我 git push origin <tagname>
时,我得到了这个 Everything up-to-date
。我看到了我的 GIT Repo
,没有任何东西被推送。在查看了一些答案之后,我终于找到了部分对我有用的东西,那就是
$ git push origin : <tagname>
这确实将我的数据推送到了存储库,但是当我检查我的 Tag
时,它并没有反映在其中,它只显示了我的最后一次提交,而不是当前的,我刚才推的。我该怎么做,才能成功将我的数据推送到特定标签?
您似乎没有标记要标记的提交,而是标记了之前的提交 - 首先您创建了一个标记,然后提交了新的更改。 git show <tagname>
是否显示正确的提交?
A tag
不会通过 git commit
.
从您的问题中提取步骤并编号:
1. git tag <tagname>
2. git show <tagname>
3. git add .
4. git commit -am "My message"
5. git push origin <tagname>
步骤 4.
的提交移动了您的活动 分支 ,它没有更新步骤 标签 创建的1.
.
如果您再次输入 git show <tagname>
,标签仍会位于其起始位置。
如果你想在本地更新标签,你必须 运行 :
git tag --force <tagname>
如果你想将该标签另外推送到源:
git push origin --force <tagname>