Patch » History » Version 5

Ivan Yiu, 2013-05-09 08:17

1 1 Eric Davis
h1. Patch
2 1 Eric Davis
3 1 Eric Davis
A patch file is a single file that will list all the changes made to Redmine.  It is the preferred way to create and share changes to Redmine.
4 1 Eric Davis
5 1 Eric Davis
h2. Creating a patch file
6 1 Eric Davis
7 1 Eric Davis
Creating a patch for Redmine is easy.  Just follow the following simple steps:
8 1 Eric Davis
9 1 Eric Davis
# Download the development copy of Redmine
10 1 Eric Davis
# _Make your changes_
11 1 Eric Davis
# Run @svn diff > PATCH_NAME.diff@ in you Redmine folder.  Change PATCH_NAME to something that describes the purpose.
12 1 Eric Davis
# Upload the patch file to an issue and share
13 2 Eric Davis
14 2 Eric Davis
h2. Applying a patch file
15 2 Eric Davis
16 2 Eric Davis
To apply a patch file you can use the "patch":http://www.gnu.org/software/patch/ program.
17 2 Eric Davis
18 3 Olafur Gislason
# Change into your Redmine directory (the one with app, test, and config folders)
19 5 Ivan Yiu
# Run @patch -p0 < PATCH_NAME.diff@
20 2 Eric Davis
# Check the messages for any errors.
21 2 Eric Davis
22 2 Eric Davis
Some errors might occur because there are changes to the same areas of code.  If you are familiar with merging code, you can try to merge the changes.  Otherwise post for help where you downloaded the patch or in the forums.
23 2 Eric Davis
24 2 Eric Davis
h2. Remove a patch file
25 2 Eric Davis
26 2 Eric Davis
To remove a patch file you can use the "patch":http://www.gnu.org/software/patch/ program.
27 2 Eric Davis
28 3 Olafur Gislason
# Change into your Redmine directory (the one with app, test, and config folders)
29 2 Eric Davis
# Run @patch -p0 -R < PATCH_NAME.diff@
30 2 Eric Davis
# Check the messages for any errors.