简体   繁体   English

如何授予Git'ForcePush'权限以将bfg-repo-cleaner结果推送到VSTS?

[英]How do I grant Git 'ForcePush' permissions for pushing bfg-repo-cleaner results to VSTS?

A person in my company who's an admin on the company's VSTS project created a repo for me, and granted me all permissions on the master branch. 我公司的一个人是公司VSTS项目的管理员,为我创建了一个回购,并授予我master分支的所有权限。

Now I need to run BFG Repro-Cleaner on my repo. 现在我需要在我的仓库上运行BFG Repro-Cleaner It worked great locally, but when I tried to git push my mirrored clone, I got: 它在本地工作得很好,但是当我尝试git push我的镜像克隆时,我得到了:

! [remote rejected] user/<someone_else>/<branch> -> user/<someone_else>/<branch> (TF401027: You need the Git 'ForcePush' permission to perform this action. Details: identity <my identity>, scope 'branch'.)
! [remote rejected] refs/pull/<number>/merge -> refs/pull/<number>/merge (TF401027: You need the Git 'ForcePush' permission to perform this action. Details: identity <my identity>, scope 'branch'.)
error: failed to push some refs to 'https://<repo>'

What permissions should I ask my admin to grant me so I can complete this? 我应该要求管理员授予我哪些权限,以便我可以完成此操作? How would she do that from VSTS web UI? 她将如何从VSTS Web UI中做到这一点?

To set Force push permission for a branch, it's located in Branch Security . 要为分支设置强制推送权限,它位于Branch Security中 If you are an administrator for the team project, you can also set it by yourself. 如果您是团队项目的管理员,您也可以自己设置。 Detail steps of setting as below: 详细设置步骤如下:

In the VSTS team project -> Code Tab -> selected the repo you are working for -> Branches Tab -> select the branch you want to set force push permission -> button -> Branch Security -> set the group you are in or add your account as user -> set Force push to Allow -> save changes. 在VSTS团队项目 - >代码选项卡 - >选择您正在工作的仓库 - >分支选项卡 - >选择要设置强制推送权限的分支 - > 按钮 - >分支安全 - >设置您所在的组或者将您的帐户添加为用户 - >将强制推送设置为允许 - >保存更改。

在此输入图像描述

在此输入图像描述

Additional to https://stackoverflow.com/a/46215134/7851959 above. 除上述https://stackoverflow.com/a/46215134/7851959之外。 You have to do the same for the branch and for the repository (Code -> Manage Repositories). 您必须为分支和存储库(代码 - >管理存储库)执行相同的操作。 Also keep in mind about default configuration: Project Collection Administrators group doesn't have the Force Push permissions. 还要记住默认配置: Project Collection Administrators组没有强制推送权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM