MS Visual Studio Code - Guide To Git
Tags: visual, studio, code, git
Published: 2017-11-30 20:32:41

---
title: MS Visual Studio Code - Guide To Git
published: true
description: A quick guide to using git with MS VS Code
tags: visual, studio, code, git
---

Hello guys again, this is Muhammad Habib Jawady and today I will be showing you how to use MS visual Studio Code in order to work with git properly. This will be a hands on tutorial, I hope you will find this useful as the number of users of ‘Code’ has grown dramatically throughout the year and the need for a full tutorial on how to use it is became an urge to help people master its enormous number of features.

For full documentations of VS Code, I will recommend visiting the official documentation at : [Docs](https://code.visualstudio.com/docs). I will skip introducing this Code editor and I will assume that you have prior basic knowledge with code editors and IDEs . For additional info on the matter, you can visit this guide and gain a basic awareness of git concepts .  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image002.jpg)  
  
**GIT CLONE**

First, we will be creating our demo project, the repository name is  ‘demo-for-vs’ and initialize it with a README markdown , aka README.md  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image003.jpg)  
  
Then, we will copy the cloning .git url located in the top right corner and open MS VS Code menu to choose the option ‘clone git repository’ from the welcome page on startup window and paste that URL.  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image004.jpg)  
  
We hit enter and fill where we want our repository to be cloned and then we choose ‘Open repository’ from the next  pop up .

**Making/Staging changes**

Now let’s make some changes to our local version . For this, I will change the size of our title in the README file and add a new file ‘index.html’.

If you click on the ‘Source control’ tab located on the left (under the search logo), you should be able to see this,  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image005.jpg)  
  
And you can notice that on the left, there is the original version, and on the right your local version.

Now we will have to stage our changes by hitting the ‘+’ icon on the right of the files’ names.

**Git commit**

In order to make a commit, you will have to hit that  button on top of the files as shown below,  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image006.jpg)  
  
**Git push**

In order to apply changes in the original repository, we will use run the regular push command from the terminal which is integrated in Code.

For this purpose, we first go to ‘view’ &gt;&gt; ‘Integrated Terminal’,  
  
![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image007.jpg)  
  
Then we run - _git push origin master  ![Visual Studio ](http://csharpcorner.mindcrackerinc.netdna-cdn.com/article/ms-visual-studio-code-guide-to-git/Images/image008.jpg)  _—-&gt; Success ^^

I hope you learned something new today … For any inquiry, feel free to submit a comment .