nopara73

Untitled

Aug 29th, 2020 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. I created 2 folders: foo and bar.
  2. Both has in it a same.txt which is the same and a diff1.txt which differs.
  3. Both has a buz folder (to test recursivity) and the bars have a same.txt and a diff2.txt.
  4.  
  5. -> foo/bar
  6. -> same.txt
  7. -> diff1.txt
  8. -> bar
  9. -> same.txt
  10. -> diff2.txt
  11.  
  12. I executed `git diff foo bar` and `git diff --no-index foo bar`. 2 questions I look for ansers now:
  13.  
  14. - There is zero difference from the outputs. So what's --no-index is?
  15. - They both found the diff for buz/diff2 so is --recursive the default behavior?
  16. Next, I executed `git diff help` and I'm immediately thrown a warning in my face: "warning: Not a git repository. Use --no-index to compare two paths outside a working tree". This makes me conclude that whatever I do --no-index will be needed.
  17. Next I started to investigate your `git diff --recursive --brief from{Build,Google}` suggestion and now I'm realizing it isn't supposed to be "git diff" as neither --recursive nor --brief is a git diff option ("error: unknown option `recursive'")
  18. In fact google doesn't have results for "diff --recursive --brief" so I'm not quite sure wher you got that from?
  19.  
  20.  
  21. C:\Users\user\Desktop\delme2>git diff foo bar
  22. diff --git a/foo/buz/diff2.txt b/bar/buz/diff2.txt
  23. index 534e3eb..74454b9 100644
  24. --- a/foo/buz/diff2.txt
  25. +++ b/bar/buz/diff2.txt
  26. @@ -1 +1 @@
  27. -xyz1
  28. \ No newline at end of file
  29. +xyz2
  30. \ No newline at end of file
  31. diff --git a/foo/diff1.txt b/bar/diff1.txt
  32. index da24a33..796740f 100644
  33. --- a/foo/diff1.txt
  34. +++ b/bar/diff1.txt
  35. @@ -1 +1 @@
  36. -abc1
  37. \ No newline at end of file
  38. +abc2
  39. \ No newline at end of file
  40.  
  41. C:\Users\user\Desktop\delme2>git diff --no-index foo bar
  42. diff --git a/foo/buz/diff2.txt b/bar/buz/diff2.txt
  43. index 534e3eb..74454b9 100644
  44. --- a/foo/buz/diff2.txt
  45. +++ b/bar/buz/diff2.txt
  46. @@ -1 +1 @@
  47. -xyz1
  48. \ No newline at end of file
  49. +xyz2
  50. \ No newline at end of file
  51. diff --git a/foo/diff1.txt b/bar/diff1.txt
  52. index da24a33..796740f 100644
  53. --- a/foo/diff1.txt
  54. +++ b/bar/diff1.txt
  55. @@ -1 +1 @@
  56. -abc1
  57. \ No newline at end of file
  58. +abc2
  59. \ No newline at end of file
  60.  
Add Comment
Please, Sign In to add comment