prof-rossetti / intro-to-python

An Introduction to Programming in Python
Other
97 stars 244 forks source link

Git Collaboration between Forked Repos #58

Open s2t2 opened 3 years ago

s2t2 commented 3 years ago

Step 1: Fork the "upstream" repo. This creates an "origin" repo under your own control. Step 2: Clone the forked repo. Step 3: Add "upstream" remote address Step 4: Checkout a new feature branch, and make commits there, and push commits to origin branch. Optionally create a PR against your origin repo to do a preliminary code review, post comments, etc. Step 5. When ready, create a PR against the upstream repo. Step 6: A maintainer of the upstream repo will review your PR, and if everything looks good, merge your changes in to the upstream master branch.

After your pull request is merged:

git checkout master
git fetch upstream
git pull upstream master
git push origin master

If something goes wrong, you can reset your repo to reflect the current state of the upstream repo:

git checkout master # if not already there
git reset --hard upstream/master
git push origin master