I use git in a Linux system and a mac. In my Linux machine, when I have no local commits and I just git pull from origin, it just forwards to the latest commit in mainline. However, when I do the same in my mac, it always creates a merge commit regardless of whether I have local commit or not.E.g.:
alias gln='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative -n'
Original state (In Linux & Mac):
gln 2
* 6b05c11 - (HEAD -> mainline, origin/mainline, origin/HEAD) Original HEAD commit message (1 year, 4 months ago) <User1>
* f8cf2ee - Very old commit message (1 year, 8 months ago) <User1>
Git pull in Linux (just forwards, no merge commit)
gpl
gln 4
* ef1d887 - (origin/mainline, origin/HEAD) Remote commit message 2 (9 weeks ago) <User2>
* 190df9c - Remote commit message 1 (9 weeks ago) <User2>
* 6b05c11 - Original HEAD commit message (1 year, 4 months ago) <User1>
* f8cf2ee - Very old commit message (1 year, 8 months ago) <User1>
Git pull in Mac, it pulls & creates a merge commit
gpl
gln 5
* 254b0c7 - (HEAD -> mainline) Merge branch 'mainline' of ssh:......../MyPackage into mainline (7 seconds ago) <Myself>
|\
| * ef1d887 - (origin/mainline, origin/HEAD) Remote commit message 2 (9 weeks ago) <User2>
| * 190df9c - Remote commit message 1 (9 weeks ago) <User2>
|/
* 6b05c11 - Original HEAD commit message (1 year, 4 months ago) <User1>
* f8cf2ee - Very old commit message (1 year, 8 months ago) <User1>
Now I always have to do 'git rebase -i' in my Mac after every pull to get rid of the merge commit (which just shows a noop message and rebases right away).
[Question] Is there any configuration I can change to make my mac git behaviour similar to my linux git behaviour?