使用特定凭据删除远程标签
是否可以使用特定的用户名和密码删除Azure中的git远程标签?我知道下面的代码可以删除远程标签,但我希望使用具有删除权限的特定用户名和密码来执行此操作。
git push --delete origin Tagname
Is it possible to delete git remote tags in Azure by using a specific username and password? I know below code can delete remote tags but I was hoping to use a specific username and password with delete permissions for this operation.
git push --delete origin Tagname
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试通过调用 REST API 来编写脚本 (Refs - 更新 Refs) 使用特定凭据删除远程 Git 标记,
因为 Azure DevOps 不再支持 Alternate凭据身份验证,我们不能使用用户名和密码来执行此操作,但是我们可以使用 PAT。
然后,您可以为 PAT 创建一个秘密变量,并添加 命令行任务 或 要运行的 PowerShell 任务管道中的脚本。
下面的PowerShell脚本供您参考:(相应地替换参数)
You can try to write a script by calling the REST API (Refs - Update Refs) to delete the remote Git tags using specific credential,
Since Azure DevOps no longer support Alternate Credentials authentication, we can not use username and password to do that, however we can use the PAT of the specific user to authenticate.
Then you can create a secret variable for the PAT, and add a Command line task or PowerShell task to run the script in pipeline.
Below PowerShell script for your reference: (replace the parameters accordingly)