DEV Community

Discussion on: Sharing Diffs on Dev.to?

Collapse
 
philnash profile image
Phil Nash

You can share diffs using the regular code fences in markdown. Just start the code fence with: three backticks and then diff (I can't escape the backticks to show you 😖).

Then it will look something like this:

diff --git a/Gemfile.lock b/Gemfile.lock
index da900f1..a5c96ce 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -82,7 +82,7 @@ GEM
       railties (>= 4.1.0, < 6.0)
       responders
       warden (~> 1.2.3)
-    devise-authy (1.10.0)
+    devise-authy (1.9.0)
       authy (>= 2.7.2)
       devise (>= 3.0.0)
     erubi (1.7.1)
Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

That's awesome!

That will work great for simple diffs, but how would I share, say, a whole-file diff, ignoring whitespace?