Jürgen Paul
Jürgen Paul

Reputation: 15007

Set as default merge branch

I have a master branch which I always merge with development. Is it possible to set development as the default merge branch? (To save a few types). Instead of typing:

$ (master) git merge development

I would just have to

$ (master) git merge

Upvotes: 0

Views: 151

Answers (2)

Klas Mellbourn
Klas Mellbourn

Reputation: 44377

This is probably not something you want to do, but you could set you local development branch to be upstream to master

git branch -u development master

And then set upstream to be default merge

git config merge.defaultToUpstream true

Then git merge on master will do what you want. Please note, however, that the branch command above will also change the meaning of push and pull.

Upvotes: 0

Gabriele Petronella
Gabriele Petronella

Reputation: 108101

No it's not possible using git options.

An option to consider would be to use a workaround, defining an alias for your shell like

alias 'gitmd'='git merge dev'

Upvotes: 2

Related Questions