1
votes

I am using visual studio 2017 and GIT.

I can connect to the GIT project, branch and pull the code.

When I make changes to the code, commit, and push to remote server, I have to raise a pull request to merge the code to another branch. Once the pull request succeeds, then the branch gets automatically deleted on the server. But it still exists locally. How do refresh my local branch to have same branches as that of server? I tried fetch but that is not getting rid of local branch (which was deleted from server).

2
Does this answer your question stackoverflow.com/questions/5751582/… ? Otherwise you can do as stackoverflow.com/questions/2003505/…k88
I would like to know how to do this in visual studio team explorer GUIvariable

2 Answers

2
votes

In Team Explorer, go to the Settings page, and then to Git Global Settings. From there, you can set the "Prune remote branches during fetch" config setting to true. This will cause all fetches from within VS to prune remote tracking branches (just like explicitly running "git fetch --prune").

This still will not delete your local topic branch, though. That is your responsibility to delete manually when you're done with it.

Hope this helps.

-1
votes

This will do it for you:

git fetch --prune --all