Add disable fast forward merge

This commit is contained in:
Chalarangelo
2021-06-22 20:41:13 +03:00
parent e76b43d8ff
commit 2c3ae2936a
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,22 @@
---
title: Disable fast forward merging by default
tags: configuration,repository,intermediate
firstSeen: 2021-07-03T05:00:00-04:00
---
Disables the default fast forwarding on merge commits.
- Use `git config --add merge.ff false` to disable fast-forward merging for all branches, even if it is possible.
- You can use the `--global` flag to configure this option globally.
```shell
git config [--global] --add merge.ff false
```
```shell
git config --global --add merge.ff false
git checkout master
git merge my-branch
# Will never fast forward even if it's possible
```