This article explains the basics of using Visual Studio Code and GitHub
Generic
- Make sure you have a GitHub Account on https://github.com
- Download and Install Visual Studio Code: Download Visual Studio Code - Mac, Linux, Windows
- Install the Visual Studio Code GitHub extension:
- See this page for information: Working with GitHub in Visual Studio Code
- This is the download link for GitHub integration: https://git-scm.com/download
Clone a Repository
- Open the Repository in GitHub
- Click on the code button and copy the URL for Cloning:
- In Visual Studio Code press [CTRL] + [SHIFT] + [P] to open the Command Palette. In the Command Palette type: Git: Clone:
- Paste the URL from GitHub
- Select the folder where you want to Clone your Repositories to and click on [Select Repository Location]
- Click [Open] or [Open in New Window] to open the cloned repository
Pull Commits from Master
- Visual Studio will, in the bottom right corner, show if there are updates that need to be pulled:
- Clicking this area will Pull Commits from the Master
Committing Changes to Master
- Before Committing you need to configure your username and email address. In the Visual Studio Code Terminal run the following commands:
git config --global user.email "[email protected]"
git config --global user.name "Sander Eek"
- In Visual Studio Code press [CTRL] + [SHIFT] + [P] to open the Command Palette. In the Command Palette type: Git: Commit:
- Choose the Repository you want to Commit and enter a Message for the Commit. Press Enter to Save
Create a Repository
- Sign-in to GitHub
- Click New Repository using the New button:
- Give your Repository a name, a meaningful description and decide if it is a public or private repository. Add a README file to indicate what the repository is about and communicate about version history and changes
- You can create a .gitignore file in your repository's root directory to tell Git which files and directories to ignore when you make a commit. If that is applicable, select the Add .gitignore option.
- If Applicable chose the right type of license for your Repository (for more information, see: Licensing a repository - GitHub Docs)
- To create the repository click:
- Use the [Add File] button to add one or more files by creating or uploading them