简体   繁体   中英

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.

Now I need to run BFG Repro-Cleaner on my repo. It worked great locally, but when I tried to git push my mirrored clone, I got:

! [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?

To set Force push permission for a branch, it's located in 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.

在此输入图像描述

在此输入图像描述

Additional to https://stackoverflow.com/a/46215134/7851959 above. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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