This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Learn the steps to clone a public repository from GitHub to your local computer using Visual Studio Code.

Clone repository

To get started, download the sample project, https://github.com/Azure-Samples/js-e2e-express-server , using the following steps:

From command palette From integrated terminal
  • Open the command palette with the key combination of Ctrl + Shift + P .

  • At the command palette prompt, enter gitcl , select the Git: Clone command, then select Clone from GitHub and press Enter .

  • When prompted for the Repository URL , select clone from GitHub, then press Enter .

  • If you are asked to sign into GitHub, complete the sign-in process.

  • Enter azure-samples/js-e2e-express-server in the Repository URL field.

  • Select (or create) the local directory into which you want to clone the project.

  • Open an integrated terminal from Terminal -> New Terminal .

  • Clone your repo with the following git command:

    git clone https://github.com/YOUR-NAME-OR-ORGANIZATION/YOUR-REPO-NAME
    
  • Change your terminal into that new subdirectory:

    cd YOUR-REPO-NAME
    
  • Then open in Visual Studio Code:

    code .
    
  • Select source control from the activity bar, or use the key combination of Ctrl + Shift + G.

  • Select Initialize repository.

  • Open the command palette with the key combination of Ctrl + Shift + P.
  • Filter with Git, then select Initialize repository.
  • Select the folder to select as the root of the repository.
  • Create a branch for changes

    From command palette From status bar From integrated terminal
  • Select the branch name in the status bar. This opens the command palette.

    The status bar is usually found at the bottom of Visual Studio code.

  • In the command palette, select +Create a new branch.

  • Enter your new branch name.

  • Enter a new branch name. The branch name is visible in the status bar.

  • Open an integrated terminal from Terminal -> New Terminal.

  • Create a new branch named MY-BRANCH with the following git command:

    git checkout -b MY-BRANCH
    
  • Open the command palette with the key combination of Ctrl + Shift + P.

  • In the command palette, filter with Git then select Commit.

  • Enter your commit message, then press Enter.

  • Switch to the activity bar and select the Source control icon or use the keyboard commands: Ctrl + Shift + G.

  • In the command palette, filter with Git then select Commit.

  • Enter your commit message, then press Enter.

  • Open the command palette with the key combination of Ctrl + Shift + P.
  • In the command palette, filter with Git then select Push.
  • If you have multiple upstream remotes, select the remote then press Enter.
  • View Git output

    You can view the Git commands run when you use the Source control extension. This helps debug when a command fails.

  • Select the Source Control icon from the activity bar.

  • Select the ellipsis (...) then select Show Git Output.

  •