This tutorial is mainly based on macOS/Linux/WSL. If you encounter any problems, please feel free to ask for help in the issue, our Zulip channel, or wechat TA (Zhongyi Ni).
Follow the instructions here to install Git and sign up for GitHub in here.
Type the following command in the terminal to generate an SSH key:
ssh-keygen
Type enter to use the default location ~/.ssh
. Then, use the following command to copy the SSH key to the clipboard:
cat ~/.ssh/yourfilename.pub # copy the output to the clipboard
Remember to replace yourfilename.pub
with the name of your SSH key. Then go to your GitHub account, click on your profile picture, and select Settings
. Click on SSH and GPG keys
and then click on New SSH key
. Paste the SSH key into the Key
field and click on Add SSH key
.
For more information about SSH keys, you can check here.
Open the GitHub repository, click the fork button. Then you will have a new copy of the original repository with the write permission. Open the forked repository, click on the green Code
button, and copy the SSH link.
Open a terminal and move to the directory where you want to clone the repository. Then type the following command to clone the repository to your local machine:
git clone <the SSH link you copied>
git remote add upstream https://github.com/CodingThrust/AMAT5315-2025Spring-Homeworks.git
git remote -v # check the remotes
In the second line, we added the original repository as a remote called upstream
. This is useful when you want to update your local repository to the latest version of the original repository.
You only need to do the above steps once. Every time you want to submit a homework, you don't need to do the above steps again.
- (create a working branch) Create a new branch and create a working directory corresponding to the homework, e.g.
where
git checkout main # switch to the main branch git pull upstream # sync the main branch with the upstream git checkout -b hw1/zhongyini # create a new branch for the homework mkdir hw1/zhongyini/ # create a working directory for the homework
zhongyini
should be replaced by your own name in lower case andhw1
should be replaced by the correct homework number. - (finish your homework) Finish your homework in this folder. The homework description is in the
hw1/README.md
file. - (save your work) Commit your changes and push the changes to your remote repository with the following commands:
git add -A git commit -m 'some message' git push
- (submit your work) Go to the forked repository webpage, click on the
Contribute
button and thenOpen pull request
or clickCompare & pull request to create a pull request
. The title should be the same as the folder name, e.g.hw1/zhongyini
in the above example. After clickingCreate pull request
, you can see the PR on the webpage. - (correct your homework) If you receive feedback from the instructor or the TA, please update your homework and push the changes to the remote repository with the following commands:
git add -A # make sure your are in the right working branch git commit -m 'some messsage' git push
- (grading) Your homework will be graded after the PR is merged. The default deadline is 2 weeks after the homework is released. The submission order matters. The first one to submit the correct answer will get extra credit.