0

I'm often running

git subtree pull -P shared shared master

but I usually forget to put --squash at the end which ends up duplicating most of my git history. Is it possible to make git use that by default?

Thanks!

Ingo
  • 802
  • 9
  • 21

1 Answers1

0

You can use:

git config branch.master.mergeoptions "--squash"

or if you want this behavior to be global to all your git projects:

git config --global branch.master.mergeoptions "--squash"

Edit:

As Ingo pointed out, this solution will apply the --squash option to merge operations in general.

Julien Lopez
  • 1,794
  • 5
  • 18
  • 24
  • Doesn't this apply to all merges? Not only when using subtrees? – Ingo Mar 29 '16 at 14:42
  • Yes it does. I edited my answer with your remark. I don't think there is anything specific to subtrees in `git config`, so if you want that, I think you are stuck with learning to add the option every time or use an alias. :-) – Julien Lopez Mar 29 '16 at 14:48