Git Product home page Git Product logo

Comments (11)

aeschli avatar aeschli commented on September 21, 2024 2

The WSL extension runs WSL with its default user. See https://learn.microsoft.com/en-us/windows/wsl/basic-commands#change-the-default-user-for-a-distribution on how to change that user.

from vscode.

x-dean avatar x-dean commented on September 21, 2024 1

As i have exported and imported this distribution a couple of times there was not possible to do it by pwsh, but I could do it from wsl.conf. Now from embedded terminal in VS Code the user is correctly selected.
Thanks for your support!

from vscode.

lszomoru avatar lszomoru commented on September 21, 2024 1

Thank you @aeschli! @x-dean, glad to hear that everything is working as expected.

from vscode.

lszomoru avatar lszomoru commented on September 21, 2024

@x-dean, does VS Code show the quick input to enter your passphrase for other git operations?

from vscode.

x-dean avatar x-dean commented on September 21, 2024

@x-dean, does VS Code show the quick input to enter your passphrase for other git operations?

No, it does not show quick input in any git operation

from vscode.

lszomoru avatar lszomoru commented on September 21, 2024

@x-dean, that seems to indicate that authentication request never reaches VS Code. VS Code is last in the git authentication pipeline so I was wondering if you have anything configure in your git config to handle SSH authentication requests.

from vscode.

x-dean avatar x-dean commented on September 21, 2024

@x-dean, that seems to indicate that authentication request never reaches VS Code. VS Code is last in the git authentication pipeline so I was wondering if you have anything configure in your git config to handle SSH authentication requests.

Just retried so to give the correct answer.

$ eval `ssh-agent -s`
Agent pid 6853
$ ssh-add ~/.ssh/my.private
Enter passphrase for /home/sysadmin/.ssh/my.private:
Identity added: /home/sysadmin/.ssh/my.private (/home/sysadmin/.ssh/my.private)
 pidof ssh-agent
6853

VS Code
After enabling ssh-agent I tried to push from VS Code and the issue persists and keep staying at this stage (it does commit):

Then from terminal:

 git status
On branch branch
Your branch is ahead of 'branch' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
[sysadmin@laptop:~=$ git push
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (15/15), 1.51 KiB | 258.00 KiB/s, done.
Total 15 (delta 5), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (15/15) (100 ms)
remote: Validating commits... (1/1) done (0 ms)
remote: Storing packfile... done (85 ms)
remote: Storing index... done (79 ms)

from vscode.

lszomoru avatar lszomoru commented on September 21, 2024

@x-dean, thanks for the additional details. Based on the information that you have shared you have added your SSH key with the passphrase to the ssh agent so this should have worked seamlessly from VS Code. You are running version 1.86 so I was wondering if you could install the latest version? After you install the latest version, please go through these steps:

  1. Close all instances of VS Code
  2. From a command prompt window run set GIT_TRACE=1 && code
  3. Open the integrated terminal and run git pull. You should see detailed logs related to SSH auth
  4. Click the "Sync Changes" button, or invoke the "Git: Pull" command.
  5. Open the https://code.visualstudio.com/docs/sourcecontrol/overview#_git-output-window and look at the logs.

We should try to compare the logs generated by step 3) and step 4). Please feel free to share them.

from vscode.

x-dean avatar x-dean commented on September 21, 2024
Version: 1.89.1 (user setup)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045

I think i understood where the issue is!

After I tried git pull from integrated terminal it worked, also from VS Code git GUI.

git pull
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Already up to date.

But the prompt is like this:


VS Code uses "root user" to perform tasks in wsl (at least in my case) and it was needed to perform any git ssh command towards repo to add IP at known_hosts and maybe start serving ssh-agent.

Can I change VS Code to use by default the user which invokes code from terminal ?

from vscode.

lszomoru avatar lszomoru commented on September 21, 2024

@x-dean, glad that you were able to get to the bottom of this. From the data that you have shown I see two different WSL users (sysadmin, and root). @aeschli, how does VS Code pick a user within WSL to use when connecting to WSL?

from vscode.

x-dean avatar x-dean commented on September 21, 2024

@lszomoru thanks for your support!

from vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.