commit patches to Darcs, Git, Mercurial, Bazaar, Monotone, Subversion, or CVS repositories

Jim Radford and I wrote a neat little utility that lets you check in select portions of a file into Darcs, Git, Mercurial, Bazaar, Subversion, or CVS repositories. It comes as a command line app and also and emacs interface.

See my blog entry about commit-patch for some detailed information on why you might want to use commit-patch.

The current version is 2.6.2: Download (86K)

Debian "Wheezy" (7.0), "Testing", and "Unstable" now provide commit-patch. Simply "apt-get install commit-patch" if you have a Debian system.

Read the ChangeLog.

The development repository can found at github. You can get it like this:

  git clone git://


commit-patch relies on several programs to get the job done:

and, of course, one of:

commit-patch is known to run on Linux and Mac OS X. It is written in perl, so ideally it will run anywhere, but we have never tested in other environments, most notably Windows. Use at your own risk.



See the man page.


commit-patch-buffer.el is an emacs interface to commit-patch. It allows you to just hit C-c C-c in any patch buffer to apply and commit only the changes indicated by the patch, regardless of the changes in your working directory.

To use commit-patch-buffer with diff mode automatically, add this to your emacs init file:

(eval-after-load 'diff-mode
             '(require 'commit-patch-buffer nil 'noerror))

The easy way of working with commit-patch-buffer is to M-x vc-diff a file (or M-x vc-root-diff your whole project) then kill, split or edit the resulting hunks using diff mode's built-in commands and to then hit C-c C-c to commit the patch.

Older versions

The older bash version that only supports CVS can be found here:


  • David Caldwell
  • Jim Radford

Copyright And License

Copyright © 2003-2013 by David Caldwell and Jim Radford.

commit-patch is distributed under the GNU General Public License. See the COPYING file for more details.

Last Modified on: Sep 6, 2021 12:25pm