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

Share Git user.name and user.email to containers #1729

Closed
JohnGalt1717 opened this issue Oct 25, 2019 · 10 comments
Closed

Share Git user.name and user.email to containers #1729

JohnGalt1717 opened this issue Oct 25, 2019 · 10 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@JohnGalt1717
Copy link

Every time we rebuild a container we have to reset these options.

It would be really nice if vs code would pick up the .git local project settings for this and if that isn't set, pick up the ones from global and pass them in as the appropriate environment variables.

@chrmarti
Copy link
Contributor

chrmarti commented Nov 8, 2019

If you use a devcontainer.json we already copy the user's .gitconfig to the container. Does that not work? (If you attach to a container, there is a fix in the next release that makes this work for that case too.)

@chrmarti chrmarti self-assigned this Nov 8, 2019
@chrmarti chrmarti added containers Issue in vscode-remote containers info-needed Issue requires more information from poster labels Nov 8, 2019
@JohnGalt1717
Copy link
Author

Problem is that if you set it globally it doesn't seem to pass the environment variables or anything to the containers. If you set them locally to the repo then it works fine.

@chrmarti
Copy link
Contributor

chrmarti commented Nov 8, 2019

Could you elaborate? Which environment variables? By 'globally' you mean the user's .gitconfig?

@JohnGalt1717
Copy link
Author

git config --global user.email "MY_NAME@example.com"

These should be passed into the container somehow so that they work if they're not set in the local project.

@chrmarti
Copy link
Contributor

chrmarti commented Nov 8, 2019

Does that store it in your home folder's .gitconfig?

@JohnGalt1717
Copy link
Author

Don't know. But it's the default in VS.net (full fat)

@chrmarti
Copy link
Contributor

Please check what's in your %USERPROFILE%\.gitconfig.

@JohnGalt1717
Copy link
Author

Yup. That's where it's set.

@chrmarti
Copy link
Contributor

@JohnGalt1717 Could you give VS Code Insiders a try? The Remote-Containers extension comes in a slightly newer version with fixes in that area for that. See: https://code.visualstudio.com/insiders/

@JohnGalt1717
Copy link
Author

Appeared to work. Thanks!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants