Gitpod: Support "Keep my email address private"

Created on 17 Mar 2019  路  11Comments  路  Source: gitpod-io/gitpod

Currently, git config user.email is forced be the one primary in GitHub.
I want to use [email protected] by default when Keep my email address private is enabled ( https://help.github.com/en/articles/about-commit-email-addresses ).
Otherwise, users have to run git config --global user.email "[email protected]" everytime starting new projects.

GitHub auth enhancement

Most helpful comment

A workaround for this is to go into _Environment Variables_ and to add GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL. I set both to my [email protected] and it works perfectly!

All 11 comments

This would be really nice! :)

A workaround for this is to go into _Environment Variables_ and to add GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL. I set both to my [email protected] and it works perfectly!

@Vlaaaaaaad It doesn't seem to work for me. Do you need to restart the workspace?

Still, it's Gitpod better make a setting in the GUI for better user experiences.

@CreatCodeBuild yes I think you'd need to restart your workspace for the environment variables to be set.

Also, please make sure that the variable scope properly matches the repository (e.g. scope */* will expose your variables for every project)

Details:

gp env GIT_AUTHOR_EMAIL=your_value
gp env GIT_COMMITTER_EMAIL=your_value

Then restart your workspace.

Setting GIT_COMMITTER_EMAIL in the environment variables page didn't work for me. I had to use this in the .gitpod.yml file:

- command: git config --global user.email $GIT_COMMITTER_EMAIL

I tried it as an init only command, but the environment variables aren't set by that point.

I have the following set

$ gp env
[email protected]
[email protected]

But git config -l still shows my primary email.

But git config -l still shows my primary email.

Which e-mail addresses are used when you commit changes? git log --pretty=fuller shows me the correct e-mail addresses I've set with GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL independent of what git config -l shows.

Note that you have to restart the workspace after setting env variables with gp env or the web interface.

thanks @corneliusludmann you're right! The env var GIT_AUTHOR_EMAIL overrides the git config for user.email. So git log --pretty=fuller shows the GIT_AUTHOR_EMAIL value.

(GIT_AUTHOR_NAME also sets the name used for the commit).

Gitlab support also would be quite nice. This should be fixed ASAP as this would result in private data (user emails) being leaked while commiting.

@sportshead: For GitLab see this related issue: #2007

Was this page helpful?
0 / 5 - 0 ratings