Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: Default "no commit" merge behaviour for all branches?

I want "git merge" to not commit by default (i.e., I want the "--no-commit" behaviour by default), regardless of the destination branch.

I know of "git config branch.master.mergeoptions" for a particular branch, and I know of "git config merge.noff no" for disabling fast-forward on all branches by default.

None of the following experiments work for me. Should they?

  • git config branch.mergeoptions --no-commit
  • git config branch.*.mergeoptions --no-commit
  • git config merge.commit no

Can't seem to find the answer via Google searches.

like image 535
beau Avatar asked Jul 09 '14 17:07

beau


People also ask

Can I merge without commit?

With --no-commit perform the merge and stop just before creating a merge commit, to give the user a chance to inspect and further tweak the merge result before committing. Note that fast-forward updates do not create a merge commit and therefore there is no way to stop those merges with --no-commit.

How do you stop git from merging?

You can use the git reset --merge command. You can also use the git merge --abort command.

Does git merge always create commit?

In these scenarios, git merge takes two commit pointers, usually the branch tips, and will find a common base commit between them. Once Git finds a common base commit it will create a new "merge commit" that combines the changes of each queued merge commit sequence.

Does git merge affect both branches?

No, merging does only affect one branch.


1 Answers

As I answered in the linked Question:

git config --global merge.commit no

I think the part which is of interest (you had tried almost the same) is the 'global' part.

like image 73
Alim Özdemir Avatar answered Sep 28 '22 05:09

Alim Özdemir