๐Ÿด 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๏ƒ

๐Ÿ“‹ Instructions:
  1. Open the URL for the GitHub Repository in your browser (the URL should be in the lab instructions)
  2. Look for the Fork button at the top right of the repository page
  3. Click the fork icon to create your own copy
Create fork button on GitHub

Step 2: โš™๏ธ Configure Your Fork๏ƒ

๐Ÿ’ก Pro Tips:
  • 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
Repository configuration window

Step 3: ๐Ÿ”— Get the Clone URL๏ƒ

๐ŸŽฏ What to Look For:
  • 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
Copy SSH clone URL

Step 4: ๐Ÿ’ป Clone to Your Local Machine๏ƒ

๐Ÿ–ฅ๏ธ Terminal Commands:

Open your terminal and run these commands:

git clone <paste-your-copied-ssh-url>
cd <repository_name>
code .
๐Ÿ“ What Happens Next:
  • 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!
Terminal commands for cloning and opening in VSCode

๐ŸŽ‰ 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 push

  • Submit your work when complete!