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

Handling either *.name or *.username in gitconfig #190

Closed
wants to merge 1 commit into from
Closed

Handling either *.name or *.username in gitconfig #190

wants to merge 1 commit into from

Conversation

hicksca
Copy link

@hicksca hicksca commented Aug 14, 2015

There might be a better way of handling this or even just switching to using git config user.name rather then user.username might help avoid trouble for users who have already setup git using official git or github documentation. Both of which seem to recommend user.name over user.username. If there is some reason behind user.username being the better option, I'd love to learn more about the topic.

What got me to digging was I ran into the issue myself and started looking at the git docs and others .gitconfig files. The only thing I'm not 100% sure about is rather this would be a no go on a none POSIX systems. (no windows machine to test on, but works like a charm on OSX and Linux)


Thanks and great work on helping newbies level up we appreciate it!

There might be a better way of handling this or even just switching to using `git config user.name` rather then `user.username` might help avoid trouble for users who have already setup git using official [git][1] or [github][2] documentation. Both of which seem to recommend `user.name` over `user.username`.  If there is some reason behind `user.username` being the better option, I'd love to learn more about the topic.

---
Thanks and great work on helping newbies level up we appreciate it!

[1]: http://www.git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
[2]: https://help.github.com/articles/setting-your-username-in-git/
@jlord
Copy link
Owner

jlord commented Aug 14, 2015

Hey, thanks for looking into this! Not treating user.name and user.username as interchangeable is intentional though.

You're right that setting up user.name is standard with Git, as well as user.email. But most often user.name is your full name, like for me, Jessica Lord. For Git-it I need to know their GitHub account name which is likely different than their full name. That's why I have users create an additional property called username. So users should set up all 3 which is why in #144 I asked the user what they had for each (but didn't get a reply).

I do see how it can be confusing though so perhaps the guide can be a bit clearer about this. Or potentially change the property to something less similar to user.name but not too long like user.githubAccountName. Do you have any ideas?

@hicksca
Copy link
Author

hicksca commented Aug 14, 2015

OK I see, making a little more sense. One other thing you may be able to clarify for me, why do you need to specify and match your name against the GitHub username? I was under the impression that GitHub associated the user with their GitHub id by matching there email. (I get wanting to make sure people understand the internals of git and its relationship to GitHub)

Just tested pushing after changing my user.name from my githubID to my full name and as far as git is concerned I'm my username because I'm pushing with 'user.email' that matches an email on file rather than say a system mail not on file with github. Other then api limitations for checking email addresses (I'm guessing, sorry if that is BS) is there a reason for check the username at all?

@jlord
Copy link
Owner

jlord commented Aug 14, 2015

why do you need to specify and match your name against the GitHub username

Because Git-it it is making requests to the GitHub API which needs a GitHub username, for instance: GET /users/:username/repos.

It is a bit confusing—GitHub is associating your Git commits to your GitHub account through your email set up in Git and GitHub, but then all of your GitHub data (which includes the Git data GitHub has collected as well as pull request, repositories, issues...) is accessible through the GitHub API with usernames.

Hope that helps! Gonna close this out and take a look at improving the guide 📖

@jlord jlord closed this Aug 14, 2015
@hicksca
Copy link
Author

hicksca commented Aug 14, 2015

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants