Jump to content

How to convert SVN formated patches for GIT


Recommended Posts

Posted

Here is what I do , there are other ways to do it (git apply is perhaps simpler), that is my peronal choice because i'm used to fix failed patches applied with "patch".

I assume you have a correctly set up local git repository.

if you want the latest mangos before applying :

git pull

apply the patch itlelf

patch -p0 < the_patch_file.patch

- fix what went wrong here -

ask git which files were changed/added:

git status

if there are added files related to the patch, tell git to handle them:

git add src/game/NewFileA.cpp
git add sql/updates/NewDirectory

commit the change to your local repository in order to have a clean one (-a tells git to commit every updated files):

git commit -a -m "added xyz patch"

the patch is now a commit in your repository, you can export it as a git patch, temporary revert it easily etc.

the next time you want tu update mangos (with git pull), the patch will be automatically "rebased" which mean that it will be reverted, then mangos will be updated, then the patch will be re-applied. worst case : re-applying fails, in which case you get a clean mangos without the patch (you will have to either fix the patch or abort it)

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use