"Holy Shit, Seriously, Learn to Read a Diff"

Posted by Ryan C. Scott on Wed 29 September 2010
I'm constantly surprised by how many developers or people peripherally involved in the development process et al freeze up when presented with a basic diff format. This format has been the lifeblood of the development world for many years. Your SCM uses it and likely can generate a list of changes between arbitrary versions, you can email them, you can post them, you can wire up a ticketing system into your SCM and read diffs corresponding to specific commits/changesets via a web interface with syntax highlighting... and in that final case, barring color blindness, if you can't figure out what the red text is as compared to the green text just quit your job and find something to which you are better suited.

Here's some information:

Here are some things that you can use it for:
  • In git (as well as svn) you can do "git diff" and see everything that is changed but not committed in your current branch/working copy.
  • "git diff > mystuff.patch" gets you a text file that can be applied with the patch command to another branch/working copy (e.g. "patch -p0 <>
  • Git/Svn (and I'm sure any SCM) has mechanisms for diffing between any two commits
  • If you reverse the order that you specify the inputs, you can get a patch that "Undoes" those changes
I don't care if I've overstated my point, because it will make you a more powerful developer and in a nebulous, hippy sense we all work together, and that means that it's important that you are powerful so I don't begin to resent you and begin to fantasize about the myriad things that might befall you.