Skip to content

Git patch

sinsunsan edited this page Nov 6, 2012 · 4 revisions
  • Create a patch out of the difference with other branch
git format-patch master --stdout > fix_empty_poster.patch
  • Create a patch out of a commit
git show HEAD > some-patch0001.patch

Replace HEAD by a commit number http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git

  • Appliquer ce patch et autocommiter un commit du changement
git am --signoff < fix_empty_poster.patch
patch -p1 -R < path/file.patch

(If your patch was applied with the -p0 option, use that instead.) Or:

git apply -R path/file.patch

WIKI by Sébastien Lucas CEO & Funder or Bricks

Clone this wiki locally