MS Visual Studio Code: Your Guide to Git
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.mdThen, 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.
Do you like to write about your infosec knowledge, skills, opinions, or exploits?
Publish your original research, tutorials, articles, or other written content on Cybray's blog to be seen by thousands of infosec readers daily!