If you’ve been using Git from within Visual Studio 2017 you might be aware of the fact that when performing a fetch it would not automatically prune your local list of branches that no longer exist on the server. Typically you would have to open up a Command Prompt and run the following command to cleanup your list of branches that exist on the remote:
> git remote prune origin
Well now with Visual Studio 2017 Update 5 you can now configure your global and repository settings to prune your local list of branches on every fetch. Let’s take a look at how you can configure this.
First download and install Visual Studio 2017 Update 5. You can do this from within Visual Studio under the Tools menu:
Once you have Visual Studio 2017 Update 5 installed, go to the Team Explorer pane and click on Settings where you can configure your default behavior for your Global and/or Repository Settings:
Now you can change the setting to prune remote branches on every fetch. In my opinion this should be the default value.
Another nice addition to the Git settings in Visual Studio 2017 Update 5 is the ability to Rebase your changes when you pull. I’ll explore that in a future post.
In summary when enabling the prune on every fetch, this means your local list of branches is always up-to-date with the remote. Pruning will cleanup and remove your local tracking branches that no longer exist on the server.
GitHub for Visual Studio 2.3 was recently released and it brought new functionality that now allows you to add pull request comments directly from the IDE.
To get started you will need the latest version of GitHub Extension for Visual Studio. Next open up a pull request from the GitHub pane and while viewing a file you can click on the left gutter (see blue plus button) to add your feedback, all without leaving Visual Studio.
This functionality is still pretty limited but its a step in the right direction. I look forward to more GitHub online functionality making it’s way to this great extension.