Always remove prefix when using git diff
When using the default git diff command it may be annoying to get the prefixed source file name:
diff --git a/config.yml b/config.yml
index cf3190e..8f0759d 100644
--- a/config.yml
+++ b/config.yml
git adds a a and b prefix and copy/paste selection isn't easy.
You can disable this default behavior by setting the following options to true:
git config --global --bool diff.noprefix true
Running git diff will now look like:
diff --git config.yml config.yml
index cf3190e..8f0759d 100644
--- config.yml
+++ config.yml
If you want to only remove the prefix occasionally, you can run git diff --no-prefix
Written by Boris Guéry
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#