Cryptic Hints
I’ve been using Github for Mac as my Git client for years now. Rarely going to the command line but this morning I figured I’d do a quick pull from the terminal and was greeted with this cryptic message:
I have no idea what any of those options are. Honestly, I really don’t care. I just want to pull the latest code down. So now I’m wasting time trying to figure out what all those options are and which one I need when I should have just used my GUI like a real dev.
Thanks to Stackoverflow, I think I found the answer for future reference:
The warning presents three commands as options, all of these will suppress the warning. But they serve different purposes:
git config pull.rebase false # merge (the default strategy)
This keeps the default behaviour and suppresses the warning.
git config pull.rebase true # rebase
This actually commits on top of the remote branch, maintaining a single branch both locally and remotely (unlike the default behaviour where two different branches are involved – one on local and the other on remote – and, to combine the two, a merge is performed).
git config pull.ff only # fast-forward only
This only performs the pull if the local branch can be fast-forwarded. If not, it simply aborts with an error message (and does not create any commits).