How to manage a tiny variation in a git repo over the long term

We have a piece of open source software deployed at a client site which is 99.9% the stock software, with one or two tiny variations – altering dependencies and a couple of config settings. The original code is in a Github repository and is developing fairly quickly. We would like to redeploy the code from time to time (probably as a fresh build, rather than pulling into the existing deployment), keeping our changes. We also need to shift the whole update process onto the client once set up.

What’s the best way to manage this? A few possibilities:

Fork and merge

We could fork the code into a new github repo, then frequently merge changes from the main repo. Some things I don’t like about this:

  1. Our changes will get buried waaaaay back in the history.
  2. It causes extra maintenance (and afaik, there’s no way to pull new changes to our repo through Github’s web app – someone would need to pull then push from the desktop)
  3. Because the code will be deployed from our repo, we’ll miss changes like new branches in the original repo, unless we’re specifically looking for them. Locally, Git will say that the deployment is “up to date”

Fork and rebase

We could fork the code, add our change, then each time we redeploy, checkout our fork, then immediately rebase it onto the latest main version.

What I don’t like:
1. Well, mostly I’m not sure if this would really work. I seem to recall getting weird merge conflicts when I tried this before.

Store the variation as a patch somewhere

Maybe we shouldn’t fork at all. Maybe we should just store the patch for our variation somewhere, then the deployment process looks like:

  1. Check out the latest main version
  2. Download and apply our patch

Improve the code so we don’t have to do this

Ideally perhaps, we’d improve the code so that all our “variations” are handled through clean configuration files, which can just be copied in, without conflicts.

Thoughts? Is this an unusual situation? Are there other solutions I’m missing? We’re not using any automated deployment tools (Chef etc) because we don’t have root access on this box (it’s all a bit messy).

Git Baby is a git and github fan, let's start git clone.