๐ด Forking Repositories Guide๏
Note
What is Forking? ๐ฏ
Forking a repository is essentially creating a copy of someone elseโs GitHub repository on your own personal GitHub account, where you can then make all the changes you want! In our case, we provide you with starter code in these repositories, which you will then fill in to complete the lab assignments.
Warning
Prerequisites โ ๏ธ
Before you begin, you must have already set up your SSH keys as described in the GitHub SSH Setup Guide.
๐ Let's Get Started!
Follow these 4 simple steps to fork your first repository and start coding!
Step 1: ๐ด Fork the Repository๏
- Open the URL for the GitHub Repository in your browser (the URL should be in the lab instructions)
- Look for the Fork button at the top right of the repository page
- Click the fork icon to create your own copy
Step 2: โ๏ธ Configure Your Fork๏
- You may change the repository name if you'd like, but it's not necessary
- Important: Make sure the Owner field shows your own GitHub account
- You can add a description if you want to keep track of what this fork is for
Step 3: ๐ Get the Clone URL๏
- You should be redirected to your forked repository page
- Notice the reference to the original repository at the top left
- Click the green "Code" button
- Select "SSH" tab
- Click the copy icon to copy the SSH URL
Step 4: ๐ป Clone to Your Local Machine๏
Open your terminal and run these commands:
git clone <paste-your-copied-ssh-url>
cd <repository_name>
code .
- The repository will be downloaded to your local machine
- All your changes will automatically sync back to your forked repository
- VSCode will open with your project ready to code!
๐ Congratulations!
You have successfully learned to fork repositories! You'll use this procedure for completing all your lab assignments. Happy coding! ๐
Tip
Next Steps ๐ก
Start working on your lab assignment
Make commits as you progress:
git add .โgit commit -m "Your message"โgit pushSubmit your work when complete!