- 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 -v
Every url should listed twice (fetch and push)
- Fetch original master
Upstream/Master
- Checkout your fork local master
Local/Master
- Merge
Upstream/Master
toLocal/Master
(Fast Forward) - Push
Local/Master
toOrigin/Master
(This will update remote master in your fork)
- Checkout your local Feature branch
Local/Feature
- Merge
Local/Master
to your Feature branch - Resolve conflicts
- Build
- Push
Local/Feature
toOrigin/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 postix to PR to get a diff file
e.g.,https://github.com/repo/pull/123
->https://github.com/repo/pull/123.patch