Clone your Fork in Bash
In DIY's open-sourcerer repo, we have a file with story in it. We need everyone to help complete the story by adding parts to it.
You need a forked file to clone so make sure you've completed the earlier challenge on forking. The fork we created is a remote (like a far away remote island) copy stored on GitHub.com but we want the files on our computer, so we need to clone (aka copy) them into a folder on our computer. Files are on your computer are considered local - they're much closer than files stored on servers who-knows-where, right?! Our clone will be linked to our fork and our fork is still linked to the DIY original.
Navigate to Folder
Open a new window in bash, or if all you've done is set up git from earlier, you're fine to use the same window. We want to use Bash to move into a folder we want to clone (copy) into. Bash starts us at the root of our computer's files.
To move to another folder, we need to change directories or cd.
In Macs type:
In Windows type:
cd My\ Documents/
The slashes let Bash know that there is a space between 'My' and 'Documents'
Now we're inside the Documents folder, let's put the DIY open-sourcerer repo in it!
Clone the Repo
We want to tell Git to go to the place where GitHub.com is remotely storing our forked files and clone them to where we are right now inside of the Documents folder on our computer. Each repo on GitHub.com has an address for its location. You'll see it following the HTTP and SSH buttons near the top middle of the page. Click on HTTP, this is the address you'll use.
git clone https://github.com/YOURUSERNAME/open-sourcerer.git
Watch as it copies the files! It will also create a folder for you with the name of the repo. When it's done cloning, move into the repo's folder:
Now we're inside our very own copy of the files. Let's use ls to list the contents of this folder to see what we've got!
You should see a list of filenames that look exactly like the files you see on the website for both DIY and your account page.
Connect to Original and Pull Changes
We have one last thing to do. Because this is an open project, we can expect that may others will be doing the same as us: forking, cloning and making changes to the files. We want to make sure we're always working with the most up to date files. To ensure this, we'll connect our local copy to the DIY original so that we can pull in the most recent changes before we work on ours.
Go back to the DIY page for Open-Sourcerer, just like our fork had an address, this repo has an address too. We're going to name this connection upstream (because this is where updates will come from).
git remote add upstream https://github.com/diy/open-sourcerer.git
Before we make any additions, we want to make sure we have the latest files by pulling in any changes from the master branch upstream.
git pull upstream master
If it says 'Already up to date' then no changes have been made since you started setting up! If there were changes, it updated your files. In both cases, your files will match the files on DIY's GitHub.com repo.