-2

The output of git diff usually looks like this:

diff --git a/tests/test_utils.py b/tests/test_utils.py
index 002d62aaf9..c28b23b0ed 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -1,3 +1,4 @@
+import os
 from datetime import datetime
 

Now I would like to copy+paste the path. In this case tests/test_utils.py

But unfortunately there is the prefix a/ before the path.

If I double click on the path the prefix gets included.

Copy+Paste of the path would be easier if there would be no prefix.

Is there a way to configure git to not output this prefix?

guettli
  • 25,042
  • 81
  • 346
  • 663
  • Please read [ask] and try searching before asking a new question. The duplicate answers all your questions and more. – CodeCaster Jan 21 '21 at 09:03
  • @CodeCaster I searched before asking. May I missed the right terms. Thank you for pointing me to the answer. – guettli Jan 21 '21 at 09:15

1 Answers1

1

diff.noprefix

If it's set, source and destination prefixes are not printed.

git config diff.noprefix yes

yes could be 1 or true, case insensitive.

ElpieKay
  • 27,194
  • 6
  • 32
  • 53