I'm still relatively new to the OMSCS, but even I've noticed that a common problem for people is not knowing how to use Git effectively in the context of the program. Some people have never had to use Git at all, which is fine; there are many VCS options out there and Git happens to be one. Other people have used it but not for the particular purpose we use it for in the program. Since some of the features, workflow, and terminology can be odd or unfamiliar even to people who have used other source control systems, I figured I could write this up and maybe help somebody.
The situation is usually, basically, this: there is some canonical (class) repository, from which you are expected to pull, and then you are on your own for where you store your changes, if at all. You can't push your work back to the class repo, since everyone else would see it. We discovered this semester that a push to a repo to which you do not have permission will become a pull request, which will be visible to everyone and will therefore be an honor code violation. So, do not try to push to the class repo.
You can't store your class work publicly, even after the class is over, since future students shouldn't be able to grab your work and copy it. Creating a fork is (in other contexts) a fine idea, but the steps required are kind of involved and there is an easier way:
Periodically during the semester you will need to get updates from the class repo, so you have to maintain your connection to it. But you also really should be pushing your work somewhere, especially if you wind up getting accused of plagiarism--it's wise to have a paper trail, just in case. What you want is to be able to keep your connection to the class repo, but make it pull-only, and at the same time have a second connection to your private repo, where you can both push and pull to support a typical workflow.
To do this, you just need to add a remote for your private repo with push/pull enabled, and then redirect any accidental push requests to the class repo to some dead-end. Here's an example from ML4T:
tlawson@tl:~/cs7646$ git clone https://github.gatech.edu/ta_account/ML4T_2017Spring.git tlawson@tl:~/cs7646$ git remote -v origin https://github.gatech.edu/ta_account/ML4T_2017Spring.git (fetch) origin https://github.gatech.edu/ta_account/ML4T_2017Spring.git (push) tlawson@tl:~/cs7646$ git remote add personal https://github.com/YourName/cs7646 tlawson@tl:~/cs7646$ git remote set-url --push origin DO_NOT_PUSH_TO_THIS_REPO tlawson@tl:~/cs7646$ git remote -v origin https://github.gatech.edu/ta_account/ML4T_2017Spring.git (fetch) origin DO_NOT_PUSH_TO_THIS_REPO (push) personal https://github.com/YourName/cs7646 (fetch) personal https://github.com/YourName/cs7646 (push)
So if you try to push to the origin remote, it will look like this:
tlawson@tl:~/cs7646$ git push origin master fatal: 'DO_NOT_PUSH_TO_THIS_REPO' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Having a name like DO_NOT_PUSH_TO_THIS_REPO will hopefully remind you to instead do it like this:
tlawson@tl:~/cs7646$ git push personal master
Hopefully this is helpful; if anything isn't clear or needs updating, feel free to let me know.