Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git delete remote branch in TFS git repository

we are using git in Team Foundation Service, and we are trying to find a way to delete a remote branch by running the following command.

git push origin --delete TheBranchName 

The remote server keep rejecting with following error

 ! [remote rejected] TheBranchName (TF401026: The ForcePush permission is required to perform this action.) error: failed to push some refs to 'https://xxx.visualstudio.com/DefaultCollection/_git/Xxxxxx' 

any idea how to set correct permission to a user in TFS?

like image 579
Eatdoku Avatar asked Mar 06 '13 19:03

Eatdoku


People also ask

How do I delete a remote branch in TFS?

Create a pull request from the branch. Once the pull request is created, abandon it. Once you abandon the request, you are presented with a delete source branch button. Click that to delete the branch.

How do I delete a branch in TFS?

Right Click the Branch and click delete and then do a Check-in.

How do I delete a remote repository branch?

To delete a remote branch, you can't use the git branch command. Instead, use the git push command with --delete flag, followed by the name of the branch you want to delete. You also need to specify the remote name ( origin in this case) after git push .


1 Answers

The security options can be accessed for the repositories at
1. Code->Explorer
2. Select a repo form the Explorer
3. At the details of the repository, you should click to the name of the repository beside the explorer.
4. Select the Manage repositories... menu

Here you can configure the rights of each contributor groups and individual users for repositories and their branches. "Rewrite and destroy history (force push)" option shound be Allow or Inherited Allow to be able to force push.

like image 129
Ursegor Avatar answered Sep 30 '22 22:09

Ursegor