如何在Ubuntu上对Github进行身份验证? git:"credential-netrc"不是git命令 [英] How to authenticate Github on Ubuntu? git: 'credential-netrc' is not a git command

查看:223
本文介绍了如何在Ubuntu上对Github进行身份验证? git:"credential-netrc"不是git命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了

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'.

到目前为止我所做的:

  1. 创建〜/.netrc
  2. gpg --gen-key
  3. gpg -e -r myemail@gmail.com ~/.netrc
  4. 通过应对添加了创建助手Perl回购~/.local/bin/git-credential-netrc
  5. 设置Git
  1. Created ~/.netrc
  2. gpg --gen-key
  3. gpg -e -r myemail@gmail.com ~/.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"

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

  1. 根据 git config显示

    git config shows

    file:/home/milenko/.gitconfig   user.email=milenko.markovic@gmail.com
    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?

    推荐答案

    您需要确保:

    • ~/.local/bin/在您的$ PATH中
    • git-credential-netrc是可执行的(chmod 755 ~/.local/bin/git-credential-netrc)
    • ~/.local/bin/ is in your $PATH
    • git-credential-netrc is executable (chmod 755 ~/.local/bin/git-credential-netrc)

    然后,您可以测试git credential-netrc(注意空格)是否会响应任何内容(即使出现错误)

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

    这篇关于如何在Ubuntu上对Github进行身份验证? git:"credential-netrc"不是git命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆