git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git merge default?

From
GAGareth Adams <gareth.adams@gmail.com>
Date
Sep 8, 2008, 18:03 UTC
Message-ID
<loom.20080908T180107-59@post.gmane.org>

Sorry that this is cross posted to git-users but I didn't realise how low traffic that list was.

Why doesn't `git merge` default to the tracked branch in the same way e.g. `git push` does?

Often I find myself performing a pull, and when I switch branch I'm told that "Your branch is behind the tracked remote branch 'origin/ master' by 12 commits". However, despite git knowing where my branch is based and how far away it is, I still have to specify `git merge origin/master` to perform the merge.

It's been pointed out that another `git pull` will usually have the same effect, but it seems that this introduces a redundant fetch, and to be honest I couldn't work out whether the pull would fail if the remote repo was unavailable for any reason.

Obviously this is a really minor point, and it doesn't exactly affect my working day for more than a few seconds, but I was curious what I was missing that such a complete package as git had this little internal inconsistency.

TIA, Gareth

Message 1 of 1 in “Git merge default?”
  1. Gareth AdamsSep 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.