Visual Studio Command Line

Update: Visual Studio Community 2019 – Git Integration
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.

  1. Visual Studio Command Line /zi
  2. Visual Studio Code - 3 - Command Line
Visual Studio Command Line


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.

Open Visual Studio. Go To 'Menubar - Tools - External Tools'. Enter Information: Title: Visual Studio 2008 Command Prompt. Command: cmd.exe. Arguments:%comspec% /k 'C: Program Files Microsoft Visual Studio 9.0 VC vcvarsall.bat' x86. Click 'Ok' and you are done. Note: If you have a different installation directory, the. Sep 16, 2011 Visual Studio enables nice features where you can do this on the Debug tab. Here are the steps to achieve this. Right Click on Project from Solution Explorer and Select Properties. In the Project Properties Windows, Navigate to “Debug Tab”. You will find the text box “Command Line”. Well, here you can type the command line.

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.


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)

Update for Visual Studio Community 2019 – Seamless Git Integration

How to Get The Command-Line ToolsWhen you choose one of the C++ workloads in the Visual Studio Installer, it installs the Visual Studio platform toolset. A platform toolset has all...

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.



Add Visual Studio Command Prompt To Visual Studio 2015

If you need to add Visual Studio Command Prompt (essentially just a command window, but pre-prepared with all your Visual Studio paths), this is how you add it to Visual Studio 2015.

  • Open Tools -> “External Tools…”
  • Click “Add”

Enter the following information into the new tool screen:

FieldValue
TitleVS Command Prompt
Command:C:WindowsSystem32cmd.exe
Arguments:/k 'C:Program Files (x86)Microsoft Visual Studio 14.0Common7ToolsVsDevCmd.bat'
Initial Directory:$(SolutionDir)

Save your changes (and re-order your tools to suit your preferences). The “VS Command Prompt” will now be available in:

Visual Studio Command Line /zi

  • Tools -> VS Command Prompt

Visual Studio Code - 3 - Command Line

Written by Steve Fentonon