Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source control for remote ssh keep displaying a message "The folder currently open doesn't have a git repository" #6637

Closed
AmirHussain93 opened this issue Apr 21, 2022 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@AmirHussain93
Copy link

AmirHussain93 commented Apr 21, 2022

I am using the latest version of vs code 1.66.2, which I have updated a week back. Everything was working fine until last Friday.

I am using remote ssh to connect to my host ubuntu machine. Source control is displaying a message "The folder currently open doesn't have a git repository. You can initialise a repository........ "

The folders which I have open are already git initialised.

Also If i am using vs code inside my Virtual machine than I am not facing this issue.

Could you please look into this ?

@bamurtaugh
Copy link
Member

Do you see anything in the Git output channel (command Git: Show Git Output)?

@bamurtaugh bamurtaugh added info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH labels Apr 22, 2022
@AmirHussain93
Copy link
Author

AmirHussain93 commented Apr 26, 2022

@bamurtaugh I run the command Git: Show Git Output and got the below output. Please refer the screenshot attached

Screenshot 2022-04-26 at 10 53 11 AM

@bamurtaugh
Copy link
Member

cc @lszomoru

@lszomoru
Copy link
Member

@AmirHussain93, thank you very much for the information that you have shared.

Also If i am using vs code inside my Virtual machine than I am not facing this issue.

Could you please elaborate on this? Do you mean that if you use remote desktop to login to the machine, and you start VS Code on the machine then everything is working as expected? So the issue can only be reproduced when you are using the SSH extension to access the machine?

@lszomoru lszomoru self-assigned this Apr 26, 2022
@lszomoru lszomoru added git bug Issue identified by VS Code Team member as probable bug labels Apr 26, 2022
@andrey18106
Copy link

andrey18106 commented Apr 28, 2022

Facing the same issue using WSL Ubuntu (with all the latest updates). Is there any solution or workaround?

UPD: Changed git version from 1:2.25.1-1ubuntu3.4 (focal-updates) to 1:2.25.1-1ubuntu3 (focal) and it works.

@vishalovercome
Copy link

Facing the same issue when accessing repo either with remote ssh (host level) as well as inside devcontainer (container level). Remote host and container host OS are both Ubuntu 20.04.

Remote - SSH - v0.78.0
Remote - Containers - v0.231.6 (or v0.233.0)

@AmirHussain93
Copy link
Author

@AmirHussain93, thank you very much for the information that you have shared.

Also If i am using vs code inside my Virtual machine than I am not facing this issue.

Could you please elaborate on this? Do you mean that if you use remote desktop to login to the machine, and you start VS Code on the machine then everything is working as expected? So the issue can only be reproduced when you are using the SSH extension to access the machine?

Hi @lszomoru
Yes this issue can only be reproduced when you are using the SSH extension to access the machine.

I have confirmed this issue with other colleagues in my team as well.

@AmirHussain93
Copy link
Author

AmirHussain93 commented May 12, 2022

I followed @andrey18106 approach by changing git version from 1:2.25.1-1ubuntu3.4 (focal-updates) to 1:2.25.1-1ubuntu3 (focal) in my remote machine. Issue is resolved but only if I am opening single folder.

If I am opening single folder I am able to see the source control changes but If I am opening multiple folders than source control changes are not available.

before this issue I used to open multiple folders and each folder was displaying source control options separately but this no longer works now.

Any update on this @lszomoru @bamurtaugh ?

@andrey18106
Copy link

andrey18106 commented May 12, 2022

@AmirHussain93 You can try also another workaround, that was mentioned in other related issues:
git config --global --add safe.directory '*'
or only for concrete directory:
git config --global --add safe.directory /path/to/repo

Also, pay attention from which user VS Code remote server is working on - for that user you should configure safe.directory.

For me, it works on WSL Ubuntu 22.04 with the latest git 2.34.1

@lszomoru
Copy link
Member

@AmirHussain93, apologies for not getting back to you on this. In case you are still experiencing the issue, can you please enable trace logging as described in this wiki, open the repository in question, and then share the contents of the git output channel. Thanks!

@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

5 participants