If you plan to write a Pull Request for Free Code Camp, you will almost certainly need a local copy of the site. Having a local copy of the site will give you additional capability with Git that are not available via the GitHub browser interface, including updating your fork and rebasing/squashing commits.
This guide will cover how to fork the FCC project, clone a local copy, and how to maintain your fork. All Git commands will be given for the command line, which we strongly recommend that you use, but most commands can be executed in a graphical Git environment as well.
Free Code Camp Issue Mods and staff are on hand to assist with Pull Request related issues on our Help Contributors Chat Room
git clone https://github.com/yourUserName/FreeCodeCamp.git
This will download the entire FCC repo to your projects directory.
$ git clone https://github.com/yourUserName/FreeCodeCamp.git Cloning into 'FreeCodeCamp'... remote: Counting objects: 37294, done. remote: Compressing objects: 100% (13/13), done. remote: Total 37294 (delta 5), reused 0 (delta 0), pack-reused 37281 Receiving objects: 100% (37294/37294), 18.69 MiB | 3.99 MiB/s, done. Resolving deltas: 100% (26053/26053), done. Checking connectivity... done. Checking out files: 100% (573/573), done.
git remote add upstream https://github.com/FreeCodeCamp/FreeCodeCamp.git
Congratulations, you now have a local copy of the FCC repo!
Now that you have a copy of your fork, there is work you will need to do to keep it current.
Do this every time prior to creating a branch for a PR:
$ git status On branch staging Your branch is up-to-date with 'origin/staging'.
git checkout staging
git pull --rebase upstream staging
This will pull down all of the changes on the official staging without making an additional commit in your local repo.
git push origin staging --force
This will overwrite the staging branch on your fork.
$ git push origin staging --force Counting objects: 99, done. Delta compression using up to 12 threads. Compressing objects: 100% (38/38), done. Writing objects: 100% (38/38), 16.14 KiB | 0 bytes/s, done. Total 38 (delta 25), reused 0 (delta 0) To email@example.com:yourUserName/FreeCodeCamp.git f7a525c..8a2271d staging -> staging