Related Microsoft Learn Materials
Instructions on forking and cloning a repo on Microsoft Docs
- Fork and clone a main branch
- Making changes to the local repo
- Staging
- Committing
First you'll set up Visual Studio Code so you can build the website locally and work with source files.
Visual Studio Code comes with an integrated terminal, so you can edit files and work from the command line all from one place.
Start Visual Studio Code.
On the View menu, select Terminal.
In the drop-down list, select command:
The terminal window lets you choose any shell that's installed on your system, like Bash, Zsh, and PowerShell.
You'll need to run a few commands to authenticate with GitHub.
Now you'll get the source code from GitHub and set up Visual Studio Code so that you can run the app and work with source code files.
Create a fork of the Sample App so you can work with and modify the source files.
A fork is a copy of a GitHub repository. The copy exists in your account and enables you to make any changes you want without affecting the original project.
To fork the Sample App into your GitHub account:
In a web browser, go to GitHub and sign in.
-
Go to the Space Game web project.
-
Select Fork
-
Follow the instructions to fork the repository into your account.
You now have a copy of the Sample App in your GitHub account. Now you'll download, or clone, a copy to your computer so you can work with it.
A clone, just like a fork, is a copy of a repository. When you clone a repository, you can make changes, verify they work as you expect, and then upload those changes back to GitHub. You can also synchronize your local copy with changes other authenticated users have made to GitHub's copy of your repository.
To clone the Sample App to your computer:
-
Go to your fork of the Sample App on GitHub.
-
Select Clone or download. Then select the button next to the URL that's shown to copy the URL to your clipboard:
-
In Visual Studio Code, go to the terminal window and run the git clone command. Replace the URL that's shown here with the contents of your clipboard.
Note
You can also run this command via a terminal
Navigate to the root directory of the Sample App.
You should see the directory and file tree in the file explorer.