Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting --ff-only as a default for git pull but not for git merge

Tags:

git

git-pull

I'm having a little problem with my colleagues and my commit history becoming unnecessary complicated when working on the same project. The problem is git pull merging non-ff if there is just a single commit difference etc. So I like to fail the git pull if a ff is not possible so that the developer can look at the commits and figure out if a merge or a rebase is more appropriate.

My question: is there a way to set --ff-only by default for all git pull commands on any branch but not for git merge? I'm aware of aliases, but that is not what I'm looking for.

like image 879
Kevin Schmidt Avatar asked Jul 23 '12 10:07

Kevin Schmidt


1 Answers

Aliases can sorta do what you need, but I'd have to agree with Christopher that you shouldn't have to be dealing with this in the first place.

Git makes branching easy, so if you want to share some code with people before its ready to merge, push to a branch.

like image 147
regulatethis Avatar answered Oct 01 '22 18:10

regulatethis