microsoft / microsoft/vscode-remote-release

Option to remove git credential config options from global git config in devcontainer

Open
#10,587 2 comments 3 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Dec 20, 2024.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I do not know if this was previously discussed here in the issues. If so, feel free to close.

The devcontainers extension forwards the git credentials configuration by creating the following config in my devcontainer's global git config:

[credential]
	helper = "!f() { /home/vscode/.vscode-server/bin/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/node /tmp/vscode-remote-containers-1ed05baf-189c-413c-bec8-ff77cfbb3f87.js git-credential-helper $*; }; f"

However, when I have custom global git configs á la:

[credential "https://mydomain.org"]

they are retained in the global git config.

However, the paths to the git-credentials plugins referenced there are not accessible from within the devcontainer.

Is there an option to make the devcontainer remove these other git credential configurations from global git config file?
If not, is there a good reason not to remove them?

And lastly: Is there an easy way to script the removal of these sections? I'm thinking of something like a postCreate hook in devcontainer.json or so.

Example error message which is from my NixOS devcontainer setup each time I pull or push something:

/nix/store/3fvqdfrjv01vgh5j22yigsbkynv2sqw2-git-credential-manager-2.5.1/bin/git-credential-manager store: 1: /nix/store/3fvqdfrjv01vgh5j22yigsbkynv2sqw2-git-credential-manager-2.5.1/bin/git-credential-manager: not found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.