vscode: Source Control no longer works on Ubuntu 20.04

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66.2
  • OS Version: Ubuntu 20.04.4 LTS

Steps to Reproduce:

  1. open a visual studio workspace
  2. click the source control button
  3. all that is shown is “Initialize Repository” and “Publish to GitHub”.

I have a .git folder in the same directory as the workspace. Running git init on the directory, or doing a fresh checkout does not help. This same folder/repository has worked for years with VS Code Source Control without issues until last week. I tried reverting the version back to March, but that did not help either.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I was able to get the latest version of VS Code (1.67.2) to work on Ubuntu 22.04 with git. I had to run this command first as non root git config --global --add safe.directory /path/to/my/repo and clone the repo with a personal access token.

Installed version 1.68.0-insiders and enabled Trace level logging. Here’s what I get:

[2022-05-19T18:18:39.256Z] > git init [7ms] [2022-05-19T18:18:39.819Z] [trace] Opening repository: myrepo [2022-05-19T18:18:39.833Z] > git rev-parse --show-toplevel [4ms] [2022-05-19T18:18:39.833Z] fatal: unsafe repository (‘myrepo’ is owned by someone else) To add an exception for this directory, call:

git config --global --add safe.directory myrepo

[2022-05-19T18:18:39.834Z] [trace] Opening repository for path=‘myrepo’ failed; ex=Failed to execute git { “exitCode”: 128, “gitCommand”: “rev-parse”, “stdout”: “”, “stderr”: “fatal: unsafe repository (‘myrepo’ is owned by someone else)\nTo add an exception for this directory, call:\n\n\tgit config --global --add safe.directory myrepo\n” }

I already tried running the add safe.directory command and I don’t notice any change. Same error in the log appears. From Googling this, it looks like it’s related to the recent Git vulnerability?

https://github.blog/2022-04-12-git-security-vulnerability-announced/

Hope this helps.

I am having the same issue.

VS Code Version: 1.66.2 OS Version: Ubuntu 18.04.6 LTS (in VirtualBox v6.1.22)

I reverted to VSCode version 1.65.2 and the issue was present there too. I can still use git through the CLI and do pulls and commits with no problem. It’s just that the source control in VSCode is not working.

I suppose Microsoft does not care about fixing this seeing as how there are 5k+ open issues. Reverting back to version Nov 2021 allows GitHub source control to work again: https://code.visualstudio.com/updates/v1_63. You have to make sure the repository has been checked out with a personal access code token and run chmod -R 777 . on the directory first.

Unfortunately, this workaround didn’t work for me. I switched to version 1.63.2 of VSCode, git cloned my repo and authenticated with my personal access token, re-set the remote set-url origin with the personal access token, chmod, git init in the directory, restarted VSCode - no dice. I still have the same source control screen where the “Initialize Repository” button does nothing.

I also attempted to go through the “Publish to GitHub” method and that did nothing either.

VirtualBoxVM_UWLXAURHZL (Ignore where the cursor is, not sure why the capture has my cursor offset from where it actually is.)

This could be related: https://github.com/microsoft/vscode-remote-release/issues/6637

i am having the same issue as well but I am running ubuntu on windows

same and, having the same issue. I click the initialize repository and choose the my project folder but nothing happens.