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

Remote-SSH: Forward Git Credential Helper #6168

Closed
chrmarti opened this issue Jan 14, 2022 · 2 comments
Closed

Remote-SSH: Forward Git Credential Helper #6168

chrmarti opened this issue Jan 14, 2022 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Milestone

Comments

@chrmarti
Copy link
Contributor

I'm in the same situation.
My laptop (Windows machine with Git installed and GCM) and GCM is not forwarded to Remote-SSH Host.

Scenario 1:
My Laptop => Remote-SSH to linux host, trying to clone a repo that have the credentials saved on the windows machine fails.
$ git config --get credential.helper empty reply

Scenario 2:
Manually upload the content of the repository to the SSH Host, because there is a .devcontainer that I want to run.
My Laptop => Remote-SSH to linux host => Reopen folder remote container works without issues.
$ git config --get credential.helper Returns
!f() { /root/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/node /tmp/vscode-remote-containers-673b0b90a3ad4447008f875661559991d7fdb747.js $*; }; f

Is there any workaround to be able to forward de GCM to the Remote-SSH host?

Originally posted by @interpeix in #5977 (comment)

@chrmarti chrmarti added the ssh Issue in vscode-remote SSH label Jan 14, 2022
@tanhakabir tanhakabir self-assigned this Jan 14, 2022
@tanhakabir tanhakabir added the feature-request Request for new features or functionality label Jan 14, 2022
@tanhakabir tanhakabir added this to the Backlog milestone Jan 14, 2022
@tanhakabir tanhakabir assigned roblourens and unassigned tanhakabir Sep 2, 2022
@iPoetDev
Copy link

iPoetDev commented Oct 6, 2022

Is this GCM (GCM-Core) or old skool GCM? Check by running the git-credential-helper-selector and choose GCM manager-core.

So a few suggestions...

[credential "protocol://hostname/path]
      helper = !<absolute path to command or script>

If host is localhost, maybe...

Where ! and everything after is a shell command and is treated as a shell script.

As I have the absolute path to set to a path and this was set by, in ~/.gitconfig, by running git-credential-helper-selector.exe from 'git/mwng64/bin/' .

Helper = !/absolute/path/to/git-credential-manager-core.exe

Also maybe you want to have this set as a --system config and not per --global config.

So map your remote command or script to a remote and add the bang character, and pass the output to a local intermediary for git to process.

Not tested, but is per gitcredentials on git-scm.com.

In theory, a helper can be any external command, script or executable in any language. Git doesn't care so long as the output is accessible.

And git credentials is not network aware for its cache Daemon as it only prefers local file systems via Unix sockets, it would go to reason that it prefers it commands and stdin/stdout as local and not on remote/network shares.

@roblourens
Copy link
Member

If this is still an issue, I need an explanation of how to forward GCM (or even what that is exactly)

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

4 participants