0

When you run git diff (specific commit)^..(specific commit), or in other words when you compare a commit to its parent, how do you know what was changed on the file. What does the change for that specific commit look like?

Tamil Selvan C
  • 19,913
  • 12
  • 49
  • 70

2 Answers2

0

The default diff output format for git diff is the "unified" format. You can find a description of the unified diff format on Wikipedia.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
0

Items removed will begin with a "-", whereas lines added will begin with a "+"

A change will often have one or more "-" lines followed by one or more "+" lines, like so

diff --git a/app.js b/app.js
index f029ded..ce7c87d 100644
--- a/app.js
+++ b/app.js
@@ -72,9 +72,9 @@ var handlers = [
    , { path: '/logout', get: routes.logout.get }
    , { path: '/register', get: routes.register.get, post: routes.register.post }
    //, { path: '/profile/:id', get: [auth.restrict(), routes.profile.get], post: [auth.restrict(), routes.profile.post] } 
-   , { path: '/profile/:user', get: routes.profile.get} 
-   , { path: '/activity/:user', get: routes.profile.get} 
-   , { path: '/activity/:user/comments', get: routes.profile.get} 
+   , { path: '/profile/:canonical_id', get: routes.profile.get} 
+   , { path: '/activity/:canonical_id', get: routes.profile.get} 
+   , { path: '/activity/:canonical_id/comments', get: routes.profile.get} 
    //, { path: '/restricted', get: [auth.restrict(), auth.verifyCertificate, routes.login.get] }
 ];
 console.log(typeof routes.profile.get);
Dorn
  • 185
  • 1
  • 7