12

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.

Cerin
  • 60,957
  • 96
  • 316
  • 522

1 Answers1

16

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
Álvaro P.
  • 1,031
  • 9
  • 9