GitHub is popular Git based SCM, hosted on cloud for storing and sharing code amongst developers. Using GitHub with Visual Studio Code lets you share your source code and collaborate with other developers right within your editor.
Pre-requisites:
Make sure Git is Enabled in Visual Studio Code
Let's make sure Git is Enabled in VS Code. Click on Manage Icon in the bottom left in VS Code. Click on Settings.
Search for Git:Enabled make sure Git: Enabled is checked.
Steps to integrate with GitHub from Visual Studio Code
1. Open VS Code, Click on Git icon as Git support is provided out of the box in Visual Studio Code.
2. Click on clone repository,
3. Click on clone from GitHub
Click on Authorize Visual Studio code
6. Now Click on Open Visual studio code
7. Choose the location where you like to clone the repo:
How to make code changes in VS Code after cloning?
Open Terminal window in VS Code
Set user Name and Email before you push code changes:
Set your username:
git config --global user.name " First Name Last Name"
Set your email address:
git config --global user.email "your@email.com"
View the entries:
git config --global --list
It should print your entries.
Now let's make some code changes, click on Explorer Icon.
Save the changes. After saving, click on Git Icon on left to see the list of files modified. You will also notice M that says modified files.
Now you can enter commit message above Commit button and Click on Commit.
Click on ... under Source Control and select Push
Now you can go into GitHub and see your code changes.
Now you can go into GitHub and see your code changes.
No comments:
Post a Comment