Kenoyer130
Kenoyer130

Reputation: 7308

Git have --no-prefix as the default?

We are using code collab and have to put the entry --no-prefix each time. Sometimes people forget and then they have to resubmit their code review. Is there a way to globally set the --no-prefix option so that the a/ b/ prefixes are never used?

Upvotes: 15

Views: 2364

Answers (2)

Cas
Cas

Reputation: 6646

I was using diff.noprefix to easily select filenames on screen. However found Yelp pre-commit couldn't re-apply generated patches as they had the toplevel directory removed. (Took me a while to figure that out!)

So rather than modifying the actual git diff command, create a di alias:

git config --global alias.di 'diff --no-prefix' 

Upvotes: 0

mipadi
mipadi

Reputation: 410662

Yep. Set the config option diff.noprefix:

$ git config --global diff.noprefix true    # All repos
$ git config diff.noprefix true             # Current repo

Upvotes: 22

Related Questions