Maintaining a fork with patches in master

Viewed 607

I want to maintain a fork with custom functionality added on top of the original code. It is not a contribution to the project itself and won't be merged upstream.

What I want to achieve:

  • The GitHub page of the fork should point to the patched version of the project instead of the original one.
  • I should be able to easily merge new upstream code while preserving a separate history for my own commits.

My current plan is to have the upstream/master branch in the fork repository as vendor, from which my own master will be branched. Whenever there is a stable release upstream I can pull & push it into the vendor branch and than rebase my master.

Questions:

  1. Is there an easier or cleaner way to achieve the same results?
  2. Should I fork via GitHub web-interface and then move master, or should I create the repository locally as described in this answer?
1 Answers

A fork is just a more formal way to link those two GitHub repo.

You don't even need to name upstream/master as "vendor": you can directly rebase your own master branch on top of that remote branch.

git fetch upstream
git checkout master
git rebase upstream/master
Related