-
Using git bash, navigate to the location you wish to create your repo. This can be done using:
cd path\to\folder\ -
Set up a new local repository from something exisiting on GitHub:
git clone <URL>The URL is copied from the GitHub repo you are wishing to create.
-
Create a new branch. You will typically always want to do this, try to never work directly on the
mainbranch.git checkout -b <branchname> -
Make your changes as needed to the code.
-
Commit all changes to branch:
git add <filenames>git commit -m "Descriptive comment of what I changed/updated" -
Push branch with changes back to the remote (origin):
git push -u origin <branchname>or for subsequent changes to the pull request, setting up the origin to track this branch is not neccessary:
git push -
On GitHub:
Click
Compare & Pull RequestRequest a reviewer (someone else on the team)
Reviewer:
-
request changes or approve.
-
in order to look at someone elses pull request on your local machine (to test the code, make sure it runs smoothly, view notebook changes, etc.), run:
git checkout <pull-request-branch-name>
Once approved: Original author merges into the
mainbranch and deletes the extra branch. -
-
Get local repo back up-to-date on the
mainbranch:git checkout maingit pull -
Delete the old local branch you were working on:
git branch -d <branchname>