- Open Git Console/Bash
- List the current configured remote repositories for your fork
git remote -v - Specify a new remote upstream repository that will be synced with the fork
git remote add upstream https://full_path_to_repo/repo.git - Verify the new upstream repository you've specified for your fork
git remote -vEvery URL should listed twice (fetch and push)
- Fetch the original master
Upstream/Master - Checkout your fork local master
Local/Master - Merge
Upstream/MastertoLocal/Master(Fast Forward) - Push
Local/MastertoOrigin/Master(This will update the remote master in your fork)
git fetch --all
git checkout master
git merge upstream/master
git push
- Checkout your local Feature branch
Local/Feature - Merge
Local/Masterto your Feature branch - Resolve conflicts
- Build
- Push
Local/FeaturetoOrigin/Feature
- Open Git Console/Bash
- Create patchfile
git diff master...Feature-Branch > diff.patch - Create a new branch from master (Feature-Clean) and apply your patch to the new branch
git apply diff.patch
- Add .patch postfix to PR to get a diff file
e.g.,https://github.com/repo/pull/123->https://github.com/repo/pull/123.patch