Skip to content

Instantly share code, notes, and snippets.

View justcaldwell's full-sized avatar

Michael Caldwell justcaldwell

View GitHub Profile
@patkujawa-wf
patkujawa-wf / git diff patch between branches.md
Created April 3, 2014 18:36
If you want to get the difference between two branches as a diff patch

If you want to get the difference between two branches, say master and branch-name, use the following command: git diff master..branch-name

If you want that same diff in a patch, because patches are handy, just add the output redirect: git diff master..branch-name > branch-name.patch

If you need to import that patch into something like Crucible then you'll need to get rid of the a and b prefixes that git adds: git diff --no-prefix master..branch-name > branch-name.patch