This article explains the basics of using Visual Studio Code and GitHub


Generic

  1. Make sure you have a GitHub Account on https://github.com
  2. Download and Install Visual Studio Code: Download Visual Studio Code - Mac, Linux, Windows 
  3. Install the Visual Studio Code GitHub extension:
    1. See this page for information: Working with GitHub in Visual Studio Code 
    2. This is the download link for GitHub integration: https://git-scm.com/download

Clone a Repository

  1. Open the Repository in GitHub
  2. Click on the code button and copy the URL for Cloning:
  3. In Visual Studio Code press [CTRL] + [SHIFT] + [P] to open the Command Palette. In the Command Palette type: Git: Clone:
  4. Paste the URL from GitHub
  5. Select the folder where you want to Clone your Repositories to and click on [Select Repository Location]
  6. Click [Open] or [Open in New Window] to open the cloned repository


Pull Commits from Master

  1. Visual Studio will, in the bottom right corner, show if there are updates that need to be pulled:
  2. Clicking this area will Pull Commits from the Master

Committing Changes to Master

  1. Before Committing you need to configure your username and email address. In the Visual Studio Code Terminal run the following commands:
    1. git config --global user.email "[email protected]"
    2. git config --global user.name "Sander Eek"
  2. In Visual Studio Code press [CTRL] + [SHIFT] + [P] to open the Command Palette. In the Command Palette type: Git: Commit:
  3. Choose the Repository you want to Commit and enter a Message for the Commit. Press Enter to Save


Create a Repository

  1. Sign-in to GitHub
  2. Click New Repository using the New button: 
  3. 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
  4. 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.
  5. If Applicable chose the right type of license for your Repository (for more information, see: Licensing a repository - GitHub Docs)
  6. To create the repository click:
     
  7. Use the [Add File] button to add one or more files by creating or uploading them