I'd like to create an alias to do the following:
Working in master
, I would like git ff
to perform git merge --ff-only origin/master
. But I want the same alias, when run in maint
to perform git merge --ff-only origin/maint
. Likewise for any other tracking branches. Is this possible?
Kudos to the other two answers, but there's an easier way, assuming that your branches are tracking the remote branches:
git pull --ff-only
Bonus: this will work even if your branches are tracking branches in a repo other than origin, or tracking differently-named branches. Also it's really short.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With