More of a personal note for future reference.
Working with a public repository on Github recently, I did the following:
Fork the project, clone the fork
git clone https://github.com/username/project-fork.gitAssign the original repo to a remote called "upstream"
git remote add upstream https://github.com/original-user/project.gitGet latest changes from upstream
git checkout master
git pull upstream masterCreate a branch for the fix
git checkout -b branch-fixCode the fixes in branch-fix
Commit my changes to branch-fix
Locally rebase the upstream branch into branch-fix
git pull --rebase upstream masterChange back to master
git checkout masterNow DO NOT merge the whole branch, BUT cherry-pick only the commit(s) from branch-fix, using commit hash.
The hash uniquely defines the commit - regardless of the branch it is in.
git cherry-pick hash123Push branch-fix up to my fork
git push origin branch-fix
 
          


