Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git merge -Xignore-space-change by default

How can I set the option ignore-space-change for all merges using git config?

I could perhaps use an alias on merge, but since I want that setting to apply to git stash pop, git stash apply, git pull and git merge, and others if any, I'd like a cleaner way than setting up many aliases (I don't even know if I could set up an alias stash for the subcommands).

I looked in the docs, but couldn't find the configuration option to use.

like image 995
Suzanne Soy Avatar asked Oct 31 '22 23:10

Suzanne Soy


1 Answers

Per-branch:

git config branch.$branchname.mergeoptions "-X ignore-space-change"

found by scanning the git config docs for "merge". If there's a global option setter I don't see it, a git alias would probably do it:

git config alias.i-s-c-merge "merge -X ignore-space-change"

and I think every shell has tab completion on git commands these days so it's git i- and tabkey instead of spacebar.

like image 91
jthill Avatar answered Nov 15 '22 03:11

jthill