exercises
and solutions-YOUR-ACCOUNT
listed on the page.On your computer, run the following commands:
$ git clone https://github.com/ICS-E4020/exercises.git $ cd exercises
We now setup git to use two remotes as follows:
$ git remote rename origin upstream $ git remote add origin https://github.com/ICS-E4020/solutions-YOUR-ACCOUNT.git $ git push -u origin
Alternatively, you can run the above commands the by executing the script ./setup-private-repo-sh
.
Now the remote upstream
should point to the read-only exercises
repository and the remote origin
points to your own private repository. During the course, you pull all exercise related material from upstream
but submit your own solutions to origin
.
After completing the above, check that
$ git remote -v
outputs the following:
origin https://github.com/ICS-E4020/solutions-YOUR-ACCOUNT.git (fetch) origin https://github.com/ICS-E4020/solutions-YOUR-ACCOUNT.git (push) upstream https://github.com/ICS-E4020/exercises.git (fetch) upstream https://github.com/ICS-E4020/exercises.git (push)
Note: You can also use GitHub via ssh. In the following, simply replace everything starting with https://github.com/ICS-E4020/
with git@github.com:ICS-E4020/
.
git add
and git commit
to commit any changes you have made as usual.git push
your changes to your GitHub repository. Remember to do this! Otherwise, your solutions never reach the course staff and you will not get any points!Once a new set of exercises has been released, execute the following command:
$ git pull upstream master
In case you want multiple copies of your private repository (e.g. you're working on several machines), execute the following after completing Step 3:
$ git clone https://github.com/ICS-E4020/solutions-YOUR-ACCOUNT.git $ git remote add upstream https://github.com/ICS-E4020/exercises.git
Read the Git tutorial first.
Typing in your username and password gets old rather quickly. To remedy this, you can generate ssh keys and use them with GitHub:
$ git remote rm upstream $ git remote add upstream git@github.com:ICS-E4020/exercises.git $ git remote rm origin $ git remote add origin git@github.com:ICS-E4020/solutions-YOUR-ACCOUNT.git
Now git pull
or git push
should not ask you your password each time.