Git diff filter gives reverse output for D(deleted) and A (added) #25997
-
Hi, I deleted two files (test1.json and test2.json) from my repository branch and run following command I was expecting output but I got actual out as I ttried adding them back and then I got output D test1.json Not sure if I am doing anything wrong… Any help? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi, I deleted two files (test1.json and test2.json) from my repository branch and run following command I was expecting output but I got actual out as I ttried adding them back and then I got output D test1.json Not sure if I am doing anything wrong… Any help? [Staff edit: Merged duplicate topics] |
Beta Was this translation helpful? Give feedback.
-
Order matters when comparing things with
|
Beta Was this translation helpful? Give feedback.
Order matters when comparing things with
git diff
. Withcurrent_commit_id previous_commit_id
in that order you’ll see what changes there are going fromcurrent_commit_id
toprevious_commit_id
, which would be your file getting added back in. Try this: 😉