MS Visual Studio Code: Your Guide to Git

November 8, 2017 | Views: 3975

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Hello, guys!

This is Muhammad Habib Jawady. Today I will demonstrate how to use MS Visual Studio Code in order to properly work with Git. This will be a hands-on tutorial that I hope you find useful. The number of users of ‘Code’ has grown dramatically throughout the year, and the need for a full tutorial on how to use it has become a matter of urgency to help people master the enormous number of features it contains.

For full documentation of VS Code, I recommend visiting the official documentation site here: Docs. I will skip introducing this Code editor and assume that you have prior basic knowledge with code editors and IDEs. For additional information on the matter, you can view this guide and gain a basic awareness of git concepts.

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

Then, we will copy the cloning .git URL located at the top right corner and open the MS VS Code menu to choose the option ‘clone git repository’ from the welcome page and startup window and paste that URL.

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 :

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 :

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 into Code.

For this purpose, we first go to ‘view’ >> ‘Integrated Terminal’ :

Then we run: git push origin master

—-> Success ^^

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

Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Ready to share your knowledge and expertise?
2 Comments
  1. Thank you very much Muhammad. Very clear and understandable.

Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel