I removed branchs (Git), but they "continue" there, how to remove it for good?

Asked

Viewed 642 times

0

Work in a team of 3 people and for each action we created a branch; over time the amount of branchs created will become great, so I decided to eliminate some branchs that are no longer being used and that would never be used again;

I first used the command git branch -d nome_da_branch;

Still not having the goal achieved, I used another command: git push origin --delete nome_da_branch;

The idea was to remove the branch from my machine and the network of all staff;

Some branchs disappeared in my local machine but not from the machine of the people who work with me; there are branchs that appear to me with the option to publish ("Publish Branch");

I would like to help with the removal of branchs; I’ve already used the command git clean -[] [n, i, f] according to the Git documentation but nothing has happened yet;

2 answers

2


To delete the remote branch:

git push nome_do_origin nome_da_branch --delete

To delete the local branch:

git branch -D nome_da_branch
  • The branchs continue to appear in the other machines connected to Release and Master and with the option of "Publish".

  • References will continue in the rest. To resolve, try the command: git remote Prune

  • Unfortunately the branchs keep appearing in Vscode. But thank you all for your help.

0

To delete a branch remote

git push orgin :nome_da_branch

To remove the reference from branch of the other developers each will have to enter the command:

git fetch -pt

The option -pt of command fetch is the junction of options -p and -t.

Local removal should occur on each machine:

git branch -D <minha_branch>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.