For many of the CodeYourFuture homework assignments, you will need to make a Pull Request to a GitHub repository. By default GitHub repos prevent most people from pushing to them. This is ensure that repo owners have control over the project.
This doesn't mean you will never be able to make changes to the repo! On GitHub you do this by creating a "fork". A fork is an exact copy of the original repo but copied to your own GitHub account. This means that now you can push to it!
This is why you will need to create a fork when submitting a PR for your homework.
What is a remote
Git has a concept of a "remote". These are other git repositories that can be connected to over the internet. You can push or pull code changes from them. Remotes have a name and a URL. Most of the remotes that you will use at CYF are hosted on GitHub, so have a github.com URL.
When you clone a repo from GitHub, the default remote is named
and the URL is set to that of the GitHub repo.
You can view the remotes you have set up with:
git remote -v
How to fork a GitHub repo
Firstly you need to click the "Fork" button:
Then you should be brought to your new fork (notice how the repo title changes):
Now you can clone from your fork by clicking 'Open in Github Desktop'
Creating a Branch
In order to be able to submit you work you must do all of your homework on a branch.
You can create a branch in Github Desktop by clicking here
You should then give your branch a sensible name
Creating a PR
So you've done your homework. You've committed your changes and are ready to make a PR. Congrats! 🎉🎉🎉
You will need to push to your fork.
If you forked and then cloned
(as in the how to fork instructions)
then you just need to run
Next you need to go the original repo in your browser (probably starting with https://github.com/CodeYourFuture). It is important that you open a pull request against the original repository.
Next click the button that says
Compare & Pull Request:
Almost there! Now fill out the PR form. Give it a sensible title and an (optional) description:
And finally click the Create pull request button at the bottom of the form:
That's it! You created your PR!