On one of my websites I have installed forum software (PunBB). Because the software doesn't offer any hooks or filters I have over time added customizations to the core. This means that updating to newer versions becomes more and more cumbersome, because I have to do everything manually.
I have never used Git before, but I've read about it. Most of the use cases start from a clean code base and use Git to track changes, but I have to start from code that has been changed extensively, and add patches to that. I haven't been able to find a way to use Git in my situation and I'd really like to know if this can be done.
Yes you can, and absolutely should.
git clone https://github.com/punbb/punbb
)EDIT: expanded step 3 by your request:
After cloning upstream repository, create your local development branch (say, mybranch
) based on upstream master currrent state:
git branch mybranch origin/master
git checkout mybranch
Edit files in this branch to reflect your local patches. However, you want this difference to be as small as possible - don't just blindly replace all files, spend some time thinking if you can stay closer to upstream.
Commit this difference into your mybranch
.
From time to time, fetch new commits to master from upstream:
git fetch origin
and merge those changes into your mybranch
(assuming that you are on it, if not, checkout to mybranch
it first):
git merge origin/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With