Jump to content

[Help] Create a GIT Patch


Guest dbl242
 Share

Recommended Posts

I have many changes on my Source code, but how do I create a patch?

Where can help me to create a howto to create a Patch?

With TortoiseSVN its very easy, but not with GIT :-(

See that bar under the "MaNGOS" logo? "Search" is in the middle.

git format-patch --stdout > my_changes.patch

Link to comment
Share on other sites

thx, but this not work ....

Patch file have 0 byte :-(

Do you have those changes in your dirty working tree? Or in a commit? If you made a commit, you need to "diff" your current state and the state before your commit:

git format-patch -1 --stdout > my_file.patch

See it's manpage for help...

git format-patch --help

Link to comment
Share on other sites

no i have many changes in the files and i have added new *.cpp files and the Problem is the new cpp files not into my Patch file.

Try this before creating the patch:

git add .
git commit -a -m "my commit"

The first command will add the new files you added.

The second command will commit all your changes.

Now you can create the patch.

Link to comment
Share on other sites

not work.

I have added a new test.cpp and used your commands and create a Patchfile, but this have 0 byte.

-rw-r--r-- 1 xxx xxx 0 2008-10-25 05:11 my_changes.patch

-rw-r--r-- 1 xxx xxx 0 2008-10-25 05:11 my_file.patch

Did you use freghar's first command (the one with -1) this time ?
Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • 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