Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cedricve/72d6417c177dbf4740e3cd75163f4e4d to your computer and use it in GitHub Desktop.
Save cedricve/72d6417c177dbf4740e3cd75163f4e4d 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