http://drupal.org/node/1022156 says I have to identify myself to git.

What if I already am, and that identity does not match what I want to use on d.org?

My git config says:

[user]
	name = joachim-n
	email = MYEMAIL

That's the username I have on github. It's not the one I have on CVS here, and I want to keep my CVS username on d.org for git on d.org.

What do I do?

Comments

eliza411’s picture

You can have more than one address in your git config file. Identifying yourself again won't negate the github address. Use git config -l to confirm.

Add the e-mail address you want to use for Drupal.org by identifying yourself. Add it to Drupal.org (and maybe git-dev, too, since the database doesn't get updated but every couple of days) on the multiple e-mail addresses. Everything should match and github should work.

Does that make sense?

joachim’s picture

> You can have more than one address in your git config file. Identifying yourself again won't negate the github address. Use git config -l to confirm.

No, that does not seem to be the case.

I took a backup of my .gitconfig file and tried the steps

$ git config --global user.name "User Name"
$ git config --global user.email "user@example.com"

and the original data is gone.

joachim’s picture

This is going to be a problem for anyone already using git for github or other projects (such as private repos used for client projects).

For Drupal, I want to use the defaults of the no-reply email and my full name; for existing projects I'm using a short username and my real email.

Also, I'm not sufficiently confident in my understanding of how git handles identities to know that I'm not risking breaking my existing repos.

eliza411’s picture

I apologize for leading you astray. I had some unchecked assumptions about how this worked based on misleading documentation.

First, you can associate the github e-mail with drupal if you like, using multiple e-mails #898816-23: Consider using real names and/or e-mail addresses for the author/committer metadata? It allows you to get credit for your commits, and the e-mail is only ever visible in the repository itself. Your git-username and your Drupal.org account are the things which are displayed on Drupal.org.

You are absolutely correct that you get one global name and e-mail. I'll be clarifying documentation about it.
You *can* also set a name and e-mail at the individual repository or the individual commit level. I'll work on clarifying the documentation.

betarobot’s picture

@eliza411 updating documentation would be great. Just stuck about the same puzzle.

Say in my case I'd use one global config for github and a few private repositories. I use user.name = "betarobot" and of course I wouldn't like to change it.

Not sure but: maybe we should advice to use some local git user.name user.email for *this* origin.

joachim’s picture

> Not sure but: maybe we should advice to use some local git user.name user.email for *this* origin.

Is there a way to set user name & email for a particular git remote? That would solve the problem.

betarobot’s picture

#6 was exactly what I mean. But at the other hand: what will happen if I'll supply my username (i.e. betarobot) as full name at d.o. config? In my case email will be the same, so only "full name" is the issue.

eliza411’s picture

I've run out of time to integrate the screen captures on http://drupal.org/node/1051722 (which need re-doing when all the interface details solidify), but I'm linking to an overview of all the different names and e-mails and how they appear.

I'm working with @sdboyer to make some official recommendations about how to best maintain two or more identities in Git.

antiorario’s picture

Maybe I'm intruding and my question is only partly relevant, but should we use our full name to identify ourselves, as recommended? Or should we use our short username migrated from CVS? Or does it not matter, because the system will use the e-mail address to match commits to the proper user? The documentation is really unclear about this.

joachim’s picture

This page explains a lot about that: http://drupal.org/node/1051722

antiorario’s picture

Thanks joachim. That's one page that should have been linked in the maintainers newsletter, but wasn't.

eliza411’s picture

That page didn't exist when the maintainers newsletter went out but it can be included in the next one.

As that page shows, from a technical perspective, it doesn't matter what you put there. I'll see if there is a recommendation from the Drupal.org social perspective.

Josh The Geek’s picture

Note to all: git-dev.d.o and future d.o will/does not care about 'full name' only email.

joachim’s picture

> Is there a way to set user name & email for a particular git remote? That would solve the problem.

I've had a read through of git docs and I can't see anything that lets you set your git user identity per-remote but system-wide. You can set it per-repo though.

Which means, unfortunately, that the only way forward I see for my case is:

- copy the current git ID in the config file to a safe place
- identify myself to git with my drupal.org name and email
- go into each repo that's for something else and set my old git ID local to that repo

This is faffy, but the best way round for future cloning of repos, as I expect to have *tons* of d.org clones (I have tons of CVS checkouts) and just a handful of git repos for sites I'm building.

Unless anyone has any better ideas?

Also, could someone confirm that changing the email and name won't affect a repo? AFAICT they are both just strings that get put into the log, and nothing to do with actual authentication.

eliza411’s picture

Status: Active » Fixed

Yes, I can confirm that they are both just strings that get put into the log, and nothing to do with actual authentication and I've done some inquiring and your plan is the best way to handle the situation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.