- From the GitHub GUI: Fork the repository (click
fork
). - From your forked repository in the GitHub GUI: Click
clone
and copy the URL. - From the command line: in the directory you want to put your local copy of the repository, type
git status
to make sure you are not already in a local git repository folder. - Then type
git clone insert_the_url_from_above
cd
into the cloned repository.git remote -v
to see the tracking versions. You should see origin, but no upstream.- From the original repository in the GitHub GUI (not yours): Click
clone
and copy the URL. git remote add upstream insert_url_of_original_repository_from_the_step_above
- the URL to insert will NOT have your username in it.git remote -v
to verify you have the origin and upstream repositories set correctly.- Rename any files (Jupyter notebooks) you will be editing that you want to save a copy of. This will prevent issues when you pull down changes after class.
- Do some work and save your changes locally and to your own GitHub repository with
git add my_file
,git commit -m "my_msg"
,git push origin master
. git fetch upstream master
to get changes from the upstream remote class repository. You should now have any changes from the upstream repo on your local machine.git merge upstream/master
to merge the changes from from upstream into your local mater branch.
Assuming you have installed Visual Studio Code, I suggust you set it as your default editor when git decides you need to do some editing. From the command line run git config --global core.editor "code -w"
.
If you haven't set VSCode to be your git editor, you might get stuck in vim. To get out of vim:
- Press
i
to enter insert mode - Type your message
- Press the
Esc
key - Enter
:x