1

I created a simple repository, edited an index.html file and published the changes to GitHub through Visual Studio Code GitLens. It works fine.

On a subsequent commit, it throws an error:

> git pull --tags origin main
From https://github.com/mySpecialRepo/myTest
 * branch            main       -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.

If I go to my local terminal and Git commit and push, it works.

  1. I tried to reinstall GitLens.
  2. Reinstalled Visual Studio Code
  3. Removed all the extensions in ~/.vscode/extensions
  4. Signed out of GitHub on the local machine and in Visual Studio Code as well.

Nothing works.

I'm on an M1 Visual Studio Code version.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dennis
  • 67
  • 7
  • Which version ***exactly*** of Visual Studio Code? (Menu *Help* → *About* ) – Peter Mortensen Nov 17 '21 at 23:57
  • This is most likely caused by the Visual Studio Code 1.62.2 update scandal. A candidate for the canonical question is *[fatal: Authentication failed for](https://stackoverflow.com/questions/69979522/)* (despite the unspecific title). – Peter Mortensen Nov 17 '21 at 23:59
  • 1
    @PeterMortensen Version: 1.62.2 Commit: 3a6960b964327f0e3882ce18fcebd07ed191b316 Date: 2021-11-11T20:53:36.800Z (1 wk ago) Electron: 13.5.2 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin arm64 20.6.0 – Dennis Nov 19 '21 at 19:33

1 Answers1

3

What's happening here is that your repository is up to date. There's a small bug in Git that makes it complain that updating isn't possible (which is true: you're up to date! No update is possible, but none is needed: Git shouldn't complain, but it does) and this discombobulates Visual Studio Code.

There are two solutions that don't involve ditching Visual Studio Code at least temporarily:

  • Upgrade Git: 2.34, just released, fixes the bug.
  • Downgrade Git: pre-2.30 or so doesn't have the bug.

There is also a workaround: configure pull.ff to true, which makes Git act like older versions that don't have a pull.ff setting of only.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
torek
  • 448,244
  • 59
  • 642
  • 775
  • Thanks.. i ended up reinstalling Git, its now 2.34 and works perfectly. Mine was 2.30 before. but the weird thing is it works on my terminal but not through vscode gitlens. So reinstalling git to 2.34 version works now. – Dennis Nov 15 '21 at 21:41
  • Yeah, this is because the terminal and VSCode don't agree on how to run `git pull`. I'm not sure the workaround with `pull.ff` actually works since I don't use VSCode. – torek Nov 15 '21 at 22:09