How to authenticate Github on Ubuntu? git: 'credential-netrc' is not a git command
Asked Answered
K

1

4

I read this and I have checked my credentials,still I can not git push.

 git push --set-upstream origin master
git: 'credential-netrc' is not a git command. See 'git --help'.

What I have done so far:

  1. Created ~/.netrc
  2. gpg --gen-key
  3. gpg -e -r [email protected] ~/.netrc
  4. Added creation helper by coping Perl repo to ~/.local/bin/git-credential-netrc
  5. Set up Git

git config --global credential.helper "netrc -f ~/.netrc.gpg -v"

  1. Editeed ~.profile according to this link.

git config shows

file:/home/milenko/.gitconfig   [email protected]
file:/home/milenko/.gitconfig   credential.helper=netrc -f ~/.netrc.gpg -v
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        remote.origin.url=https://github.com/MilenkoM/blog_mongo
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

It seems that my creation helper is not recognized. Why?

Katti answered 22/10, 2020 at 10:15 Comment(0)
O
4

You need to make sure that:

  • ~/.local/bin/ is in your $PATH
  • git-credential-netrc is executable (chmod 755 ~/.local/bin/git-credential-netrc)

Then you can test if git credential-netrc (note the space) will respond anything (even if it errors)

Opaline answered 22/10, 2020 at 11:12 Comment(2)
I forgot to change the permissions.Katti
@RichardRublev Yes, I forgot to change them as well too many time for other git command utilities, so now I am at least aware of that step.Opaline

© 2022 - 2024 — McMap. All rights reserved.