Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLens unable to pull push in Visual Studio Code

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.

like image 764
Dennis Avatar asked Aug 30 '26 00:08

Dennis


1 Answers

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.

like image 121
torek Avatar answered Aug 31 '26 18:08

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!