Hi friends 👋
I'm so excited about the GitHub Package! I seem to be unable to access cached credentials within the UI. I've been using an personal access token because I have 2FA enabled, but it's my understanding that it's not how it's supposed to work.
I get this error message whenever I perform a fetch.
git: 'credential-osxkeychain' is not a git command. See 'git --help'. fatal: could read Username for 'https://github.com': Device not configured
Sometime a pull/push works. However, it doesn't ever remember the credentials and I have to type them in every time. Do I have some wonky settings or is this a bug? Thank you!
Atom Version (atom --version):
Atom : 1.13.0
GitHub Package Version (git --git-dir ~/.atom/packages/github/.git rev-parse head):
bea2da8b554d8528dae3065a2917aec8aab05570
Same thing, it asks me for my credentials every time I push, and doesn't even mention the osx keychain. Is there a setting I need to enable?
Atom won't automatically remember credentials for you, though (yet). To do that, you'll want to install the git osxkeychain credential helper mentioned in the error message; it's included in homebrew's version of git. To be used, it needs to be on your ${PATH}:
$ which git-credential-osxkeychain
And it needs to be set in your git configuration:
$ git config --get-all credential.helper
# If it's not there:
$ git config --global credential.helper osxkeychain
Thanks @smashwilson! My own issue seems to have been resolved so I am closing it out. @cmrberry please feel free to reopen if it still doesn't work for you.
Same thing here, how did you resolve this ?
Every time i make Pull, Push or Fetch, the Atom requires my username and password
@mauriciord Are you interacting with a remote over an https or ssh URL?
For https remotes, you'll want to install a credential helper that will store accepted usernames and passwords in your OS keychain. (The specifics on configuring this vary on different platforms.)
For ssh remotes, you'll want to configure an ssh agent or (if you're also using GPG signing) a gpg agent.
As a side benefit, this will also work for remote operations on the command-line :smile:
Hey @smashwilson thanks for the help, it's a https remote, but i've already did this.
In VSCode and Terminal, i'm using normally without typing everytime the user and password.
Why only in Atom this is not working ?
When i type:
git config --get-all credential.helper
Outputs this:

Sorry for the noob question, but why 2 osxkeychain ?
Why only in Atom this is not working ?
Good question!
Can you enable "git diagnostics" in the GitHub package settings, reproduce, then open your dev tools and expand the git -c gpg.program=... commit section in your console? That will enable GIT_TRACE and capture some information that would be helpful for seeing why your credential helper isn't being invoked correctly.
Sorry for the noob question, but why 2 osxkeychain ?
I suspect one is from your system configuration and one is from your global git configuration. You can use EDITOR=echo git config --system --edit to see where your system config is (if you have git installed from homebrew, it's likely under some /usr path).
HEY @smashwilson ,
Can you enable "git diagnostics" in the GitHub package settings, reproduce, then open your dev tools and expand the git -c gpg.program=... commit section in your console? That will enable GIT_TRACE and capture some information that would be helpful for seeing why your credential helper isn't being invoked correctly.
I made this and:
git-Cgpg.txt
I used EDITOR=echo git config --system --edit and my terminal output this:
/private/etc/gitconfig
@mauriciord Excellent, thanks for the trace. I'll have a look in more detail soon.
I'm wondering if I'm passing the wrong PATH to that git invocation somehow, since git credential-osxkeychain is on your shell path... 🤔
Hmm, I have a hunch. When git executes internal processes, it prepends an exec path where the git binaries live. Dugite sets the exec path to its own, bundled tools when it runs git commands. I'm wondering if the git-credential-osxkeychain binary is in the exec path for your _native_ git install and also not on your system path. That would explain why your command-line git can find it but the dugite-managed git cannot, even with the same PATH.
From your git system path, it also looks like you're using the macOS system git rather than a homebrew install like I'm using. I'm betting homebrew puts the exec path on PATH as well which explains why it's working for me :wink:
Can you share the output from these commands to confirm:
git --exec-pathecho ${PATH}which git-credential-osxkeychainOf course @smashwilson ,
- git --exec-path
- echo ${PATH}
- which git-credential-osxkeychain
git --exec-path
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core
echo ${PATH}
/Users/mauricio/Documents/google-cloud-sdk/bin:/usr/local/heroku/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/mauricio/.rvm/bin
which git-credential-osxkeychain
Does not output anything
Ah ha! Yep, that's what's going on. A tentative solution: we can attempt to gather the exec path from a native git install and append it to the ${PATH} we use for git operations.
As a temporary workaround you should be able to run:
export PATH=${PATH}:$(git --exec-path)
And relaunch Atom.
@smashwilson running that did not work for me.
I had to add export PATH=${PATH}:$(git --exec-path) to ~/.bash_profile.
I had to add export PATH=${PATH}:$(git --exec-path) to ~/.bash_profile.
I had to add too @jaydenseric
Working now :)
➜ ~ git --exec-path
/usr/local/git/libexec/git-core
➜ ~ echo ${PATH}
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
➜ ~ which git-credential-osxkeychain
/usr/local/bin/git-credential-osxkeychain
➜ ~ git config --get-all credential.helper
osxkeychain
~/.bash_profile
export PATH=${PATH}:/mongodb-osx-x86_64-3.4.0/bin;
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
export PATH=${PATH}:$(git --exec-path)
it doesn't work for me,is anyone can help?thank you !
Word to the wise, if you follow the other tickets you'll just end up back here.
Most helpful comment
@smashwilson running that did not work for me.
I had to add
export PATH=${PATH}:$(git --exec-path)to~/.bash_profile.