Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Local config for git username #122

Open
jdarling opened this issue May 7, 2015 · 3 comments
Open

Local config for git username #122

jdarling opened this issue May 7, 2015 · 3 comments

Comments

@jdarling
Copy link

jdarling commented May 7, 2015

Seems like there isn't a way to use a local config for the git username and instead you are required to use the git --global user.username option only. Can't really do that when you have multiple git based systems with different usernames you work with.

How about allowing a local .gitinfo or some other file for configuration of the git credentials.

@beaugunderson
Copy link
Member

user.username isn't widely used, and so shouldn't affect anything else even if it's in the user's $HOME/.gitconfig

however, I think the git config module we're using already supports project .gitconfig files, so can you try adding a .gitconfig to the directory you cloned friends to and try that?

@jdarling
Copy link
Author

jdarling commented May 7, 2015

Unfortunately for me it gets used, tried creating a new .gitconfig and placing it in the project root but that fails as well. Looking at github-current-user it is getting the path from git-config-path and that is hard coded to env.HOME || env.HOMEPATH || env.USERPROFILE

So, creating the .gitconfig file as

[user]
    email = <email>
    name = <name>
    username = <username>

Then launching with:

HOME=~/friends/ npm start

Works to get around the issue, but seems like there should be another option even if its just a command line flag to set the username.

@beaugunderson
Copy link
Member

ah, damn! we've talked about a UI for the user to specify their GitHub username and I think that's probably preferable to the command line (because at some point this will be a packaged app)

in the interim we could also check process.env.GITHUB_USERNAME though, for ease of development; that would be a change to github-current-user

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants