Forking is a feature of github that creates a copy of a repository on your account. When you solve a lab, you'll be coding the solution not on the deployed copy of the lab that everyone has access too, but rather, on your copy, your fork.
- Click on the Fork Button
- Fork it to your personal github account.
- Make sure you are on your fork of the lab.
Cloning means bringing down a copy of a git repository from a remote source (like Github). It is creating another copy of a repository on your computer and allowing your local copy to communicate and update the copy on github.
- Copy your Clone URL, it should start with https://
- From your terminal, from your home directory (you can
cd ~
to quickly jump there), type in:git clone
and then paste the clone address you copied in step 1.
- Enter in your github credentials.
Note: If you have 2-factor-authentication on github turned on this won't work. Turn it off from your settings
- Your clone should now exist in a new directory named after the lab.
- cd into the lab directory so you can get to work!
After you've completed a lab post your work onto github with the following steps.
- Stage your changes for commit with
git add .
- And confirm that the file is staged for commit with
git status
- Commit the file.
git commit -am "My first commit"
- Push your work up to your fork on github.
git push
- Go to github and confirm the push.
- Click on the branch comparison icon from the repository home.
- Click Create Pull Request
- Confirm the Create Pull Request
View Forking and Cloning Labs from Github on Learn.co and start learning to code for free.