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:
- Git log: how to get all commits' stat of Github repo
- Git doesn't stage my files any longer, and reports them as both “deleted” and “untracked”. Why is that, and how to avoid it?
- Can/should I fork my own github repo?
- Scope of gc prune and git reflog expire, and related config
- Different Config Files in GitHub Repo Branch
- Delete all Git Commit History
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:
- Our changes will get buried waaaaay back in the history.
- 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)
- 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:
- Check out the latest main version
- 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).