Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 652
Jonathan Avatar asked Sep 14 '17 08:09

Jonathan


People also ask

How do you force push?

To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.


1 Answers

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.

enter image description here

enter image description here

like image 54
Marina Liu Avatar answered Oct 31 '22 18:10

Marina Liu