Skip to content

Instantly share code, notes, and snippets.

@paxan
Created August 17, 2022 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxan/2f6083fd36190ec59f1943f02fa86c6e to your computer and use it in GitHub Desktop.
Save paxan/2f6083fd36190ec59f1943f02fa86c6e to your computer and use it in GitHub Desktop.
~/.gitconfig
[pull]
ff = only
[merge]
ff = false
@paxan
Copy link
Author

paxan commented Aug 17, 2022

These settings configure pull and merge commands to be safer when working on feature branches.

Use these commands to add them to your global Git config:

git config --global merge.ff false
git config --global pull.ff only

The merge.ff=false ensures that when you merge a feature branch to your production branch (e.g. main), you will be creating a proper merge commit: the editor will be shown, allowing you to add some extra details.

The pull.ff=only ensures that Git won't create a nuisance merge commit when it sees that your local feature branch diverged from the remote feature branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment