Home > Back-end >  Gitlens unable to pull push on VSCode
Gitlens unable to pull push on VSCode

Time:11-16

I created a simple repo, edit a index.html and publish the changes to github through VSCode Gitlens. It works fine.

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 reinstall Gitlens.
  2. Reinstall VSCode
  3. Removed all the extensions ~/.vscode/extensions
  4. Sign out Github on local machine on VSCode as well.

Nothing works.

I'm on M1 VSCode Version.

Any pointers much appreciate!

CodePudding user response:

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 VSCode.

There are two solutions that don't involve ditching VSCode 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.

  • Related