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?
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.