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

git pull bug report

From
Erwin Villejo <erwinvillejo@gmail.com>
Date
Nov 15, 2021, 08:42 UTC
Message-ID
<CADL96rvRX2R_4Wm23tz88hDUztcpK531RU+Ops2UVoiOW0bCHw@mail.gmail.com>
> What did you do before the bug happened? (Steps to reproduce your issue)
* make local changes, stage, and commit
* local is ahead of upstream. confirmed by `git status`:
```
$ git status
On branch main
Your branch is ahead of 'github/main' by 1 commit.
  (use "git push" to publish your local commits)
```
* try to pull upstream to local
> What did you expect to happen? (Expected behavior)
No-op (and NO failure) since local is ahead of upstream.
> What happened instead? (Actual behavior)
`git pull` fails with error:

``` $ git pull hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. fatal: Need to specify how to reconcile divergent branches. ```

> What's different between what you expected and what actually happened?

I expected no failure and no-op since local is ahead of upstream. Instead, `git pull` fails because it thinks the branches have diverged.

> Anything else you want to add:

I found this bug in VSCode. VSCode runs `git pull` first before `git push` when pushing to upstream. This bug causes pushing via VSCode to always fail, although it can be worked around by simply opening a terminal and running `git push` manually.

[System Info] git version: git version 2.33.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.15.2-arch1-1 #1 SMP PREEMPT Fri, 12 Nov 2021 19:22:10 +0000 x86_64 compiler info: gnuc: 11.1 libc info: glibc: 2.33 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]

Best regards, Erwin

Next: Bagas Sanjaya
Message 1 of 11 in “git pull bug report”
  1. Erwin VillejoNov 15, 2021
  2. Bagas SanjayaNov 15, 2021
  3. Erwin VillejoNov 15, 2021
  4. Bagas SanjayaNov 15, 2021
  5. Erwin VillejoNov 15, 2021
  6. Erwin VillejoNov 15, 2021
  7. Bryan TurnerNov 15, 2021
  8. Erwin VillejoNov 15, 2021
  9. Junio C HamanoNov 15, 2021
  10. Bryan TurnerNov 15, 2021
  11. Erwin VillejoNov 16, 2021

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.