Skip to content

Instantly share code, notes, and snippets.

@patkujawa-wf
Created April 3, 2014 18:36
Show Gist options
  • Save patkujawa-wf/9960173 to your computer and use it in GitHub Desktop.
Save patkujawa-wf/9960173 to your computer and use it in GitHub Desktop.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment