您现在可以手动将标记添加到TFS中的提交(直接在服务器上),这可能会有所帮助。
您必须先选择一个提交,然后单击最右侧的...按钮,这将打开一个下拉菜单,其中一个选项是创建一个标记:
这也是通过REST api公开的。看到答案 这里 。
的 更新以回应有问题的EDIT 2 强>
也可以在API上创建分支。文档将分支称为“ref”:
通过从nil更新ref来实现创建ref 将(由40 0表示)提交到不同的提交。
结构是这样的(注意{project}是可选的):
POST https://{instance}/DefaultCollection /{project}/_apis/git/repositories /{repository}/refs?api-version={version} Content-Type: application/json [ { "name": {string}, "oldObjectId": {string}, "newObjectId": {string} } ]
例如:
POST https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection /_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249 /refs?api-version=1.0
使用此主体,将创建一个名为“live”的新分支:
[ { "name": "refs/heads/live", "oldObjectId": "0000000000000000000000000000000000000000", "newObjectId": "4b223e9c93ec3b6aaa6499f06e3ebb7c702e6106" }, ]
文档 这里 。
的 我的TFS版本是: 强>
目前,您只能在VS2015中创建Git标签(本地),但无法将其推送到远程服务器。你必须使用git命令行: git push --tags 推动标签。
git push --tags
但支持将Git标签推送到远程的能力的功能一直在计划中:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/10189500-support-the-ability-to-push-git-tags-to-remote