Category Archives: git

Patching with “git format-patch” and “git am”

Why Patch?

Sometimes you just have to do it live! Sometimes a fix is so crucial that you head directly to the production server, edit the code, save the file, and restart the server. It’s not an ideal situation but it happens. Most of the time, the fix is pretty small and you can just go to your local repository after things are fixed on the live server and remake the changes to your code base and commit them. When the fix is more complex, you may want to commit the code on your production server and create a patch to apply your changes to the code in the repository. If your repository is in git, here are some instructions on how to use ‘git format-patch‘ and ‘git am‘ to bring everything back in sync.

Posted in agile development, git | Tagged , , , , , , | Leave a comment