I'm trying to write an automated build script, and one step pulls and merges the upstream master into the current branch. To do this, I'm running:
git pull origin master
However, if it finds any changes, it launches a terminal editor and prompts me to enter a merge comment. Why is a pull action trying to merge, and how do I disable this so it doesn't block the automated script?
If it can automatically merge, then it should complete with with no error code and no user prompts. Only if there's a conflict, should it return an error code.
Probably you've configured your machine to execute a merge instead of a rebase while doing a pull.
Try this instead:
git pull --rebase origin master
It shall not request for your input if there's not a conflict.
Other option if you actually want the pull executed by merge instead of rebase is to resign to edit the commit message with something like this:
git pull --no-edit origin master
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