Git delete remote branch in TFS git repository Git delete remote branch in TFS git repository git git

Git delete remote branch in TFS git repository


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.


To delete a remote branch you can use:

git push origin :TheBranchName


From the git push man-page:

-f--force    Usually, the command refuses to update a remote ref that is not an ancestor of the    local ref used to overwrite it. This flag disables the check. This can cause the    remote repository to lose commits; use it with care.

Looks like the branch you are trying to delete is not an ancestor of the branch you are on -- add this --force argument and see if it helps.