Monthly Archives

5 Articles

Visual Studio Tips

How to use git command line in Visual Studio

Posted by matteskolin on

Update: Visual Studio Community 2019 – Git Integration
Click link above for Visual Studio 2019 and later with new Git Menu (preview features enabled)
The git integration with Visual studio is great. It is able to find all the git repositories on your machine and show them all nicely in the team explorer.


However, when working with git, it is very useful to see the actual command line output. Using the GUI can obscure what is actually going on.

TFVC source control has the same problem, as when getting the latest changes, you don’t automatically see everything that’s happening, unless you take the time to open the Output window and navigate to the TFVC Output, where with the default settings you only see updated files in a list.

The command line is what really lets you see the details of what’s happening, as well as giving you the ability to try out all the commands and options, not all of which are available from within visual studio.

Below we can see all the details associated with a git pull from a remote repository. Insertions, deletions, and associated counts are neatly laid out and colored in green and red.

a git pull on the command line


How to Quickly Open the Command Prompt with the Project Directory
To quickly get started with the command prompt, it is very helpful to be able to open it directly in the path for the current project. To do this right click on the local git repository in VS and select open command prompt..

This opens a cmd.exe window opened to the project directory. I don’t like having to use tools outside the IDE unless absolutely necessary, as the context switching can slow productivity. I have started using the extension below which integrates a terminal windows.

Better Integration with a marketplace Extension (vsix)

https://marketplace.visualstudio.com/items?itemName=dos-cafe.WhackWhackTerminal

Update for Visual Studio 2019 – Seamless Git Integration

UPDATE: The above extension is no longer needed, as Visual Studio now integrates a terminal via the Developer Command Prompt. At the moment, I think I do prefer the powershell terminal, as the command highlighting and colors seem to work better.


Starting with Version 16.6, git functionality is accessible from within Visual Studio without installing an additional extension.

A new Git menu appears in the window title bar. I had some difficulty getting this menu to appear in my environment, but I eventually got it to work by toggling the “New git user experience” in the Preview Features of settings. For most users, the Git menu should appear by default by installing the new version of Visual Studio.

Enabling the new git experience


I don’t like the way that we no longer get pretty list of local repos right in the teams window like this..

This same list of repositories is now only available from the new Git Menu -> Local Repositories. The repositories that appear here are dependent on the path set in the Tools -> Options -> Source Control -> Git Global Settings -> Default Location

New List of Local Repositories with the new git menu

And Now, in order to open the command prompt with the working directory at the root of a git repo, a two step process is now required. First, open the repo by clicking it in the local repo menu above. Second, return to the Git menu, and select “Open in Command Prompt”

This is more difficult than it was before, but I will be on the lookout for improvements to this and will keep you all posted..

Visual Studio Tips

Should Visual Studio users try VS Code?

Posted by matteskolin on

I have always been a user of Visual Studio proper; I have heard people talk about VS Code, and decided to check it out.

I’m impressed with how small the initial download and install was. Less than 200 MB of disk space was required on my Windows 10 PC.

The install process took less than a minute! This is much much faster than Visual Studio which could sometimes take over 30 minutes to install.

I started up the application; the dark theme came up immediately, and I started to feel right at home..

Now I want to write some C# code. What? I need to download an extension to use C#? that seems kind of strange… I’m still not sure exactly why this OmniSharp server is necessary, is this only for .Net Core? The idea of VS Code to be more modular and cross platform.

Why are there so many extensions? Coming from using mostly more legacy Microsoft development tools, I’m not used to everything being open sourced as we are seeing in the extension list here.

I’m going to need to spend more time studying the environment, and how everything works here.

I’ve always loved the full features of Visual studio proper, and fell it is the best IDE out there. But I recognize that Visual Studio has been around for a long time. What would Microsoft do if they could build a simplified IDE is what we get with VS Code. .

Opening a project as a folder is really weird. I have some folders that have sub folders that contain additional projects. VS Code doesn’t seem to recognize projects contained in these sub directories the way Visual Studio would via the .sln file.



VS Code seems to promote a different way of working, more in line with .NET Core methodology of interoperability, flexibility,minimalism, and seems to strongly prefer json and the command line to text config files.

So my advise to anyone who has not used this before. VS Code is very different; it does not appear to be an easy transition to start using this for something like a web forms projects. I’m sure it would work better if you using pure .Net Core.

Nonetheless, absolutely love the speed of VS code, and I am going to spend more time with this, explore the different extensions, and see how it goes..

Zen mode is so cool…

Zen Mode

Ctrl + K, Z — can we please get this for Visual Studo proper?