How to use Portable Visual Studio Code and GIT

I started to use Visual Studio Code as my primary Editor tool. I used portable version of Visual Studio Code and GIT to avoid installation and be able to quickly use different machines. For this purpose I also prefered to use “Workspace Settings” instead of “User Settings” in Visual Studio Code.

Download and install Visual Studio Code Portable from https://github.com/garethflowers/vscode-portable

Download and install Git Portable from https://github.com/sheabunge/GitPortable

Open Visual Studio Code and create a “Workspace Settings” with path to portable GIT and in my case Proxy Settings:

// Place your settings in this file to overwrite default and user settings.
{
    // The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
    "http.proxy": "http://192.168.1.1:80",

    // Path to the git executable
    "git.path": "C:\\Data\\GitPortable\\App\\Git\\Bin\\git.exe"
}

If you develop in powershell with this repository make sense to add Powershell Extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) and configure powershell as integrated terminal:

// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"

Open Visual Studio Code and initialize a GIT repository

VisualStudioCode_Git_Initialize

Open GIT Portable, go to local repository path and config GIT repository:

git remote add origin https://mygitserver.com/_git/mygitrepository
git config http.proxy "<a href="http://192.168.1.1:80">http://185.46.212.34:80</a>"
git config user.email "myemail@mydomain.com"
git config credential.helper wincred

Check also http://www.theregister.co.uk/2015/12/07/visual_studio_code_git_integration/ to use Visual Studio Team Service as a provider.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s