[已解决] git push 报错:git: 'credential-manager' is not a git command. See 'git --help'.

前言

本文旨在解决和git相关的两个错误情况:
1)Ubuntu下:
git: 'credential-manager' is not a git command. See 'git --help'.
2)使用ssh连接时报错:

ERROR: Permission to xxx/xxx.git denied to <xxx-user>.
fatal: Could not read from remote repository.

问题场景

  • Ubuntu 14.04

在使用git push origin master将本地修改同步到github仓库的时候,出错:

git: 'credential-manager' is not a git command. See 'git --help'.

解决方案

1)运行 git config --list,部分输出如下:

core.editor=nano
credential.helper=manager
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/xxx.git
remote.origin.fetch=+refs/heads/:refs/remotes/origin/
branch.master.remote=origin
branch.master.merge=refs/heads/master

2)运行git config --global --unset credential.helper,之后再git push orgin master即可。

备注:(使用ssh连接时出现的错误)

如果出现错误:ERROR: Permission to xxx/xxx.git denied to <xxx-user>.

依照我的博客https://blog.csdn.net/weixin_39278265/article/details/100118608 运行如下命令即可:

# 开启ssh-agent服务
eval "$(ssh-agent -s)"

# 把刚刚生成的ssh key加入到ssh-agent中
ssh-add ~/.ssh/id_rsa_aaa

参考

[1] git: ‘credential-cache’ is not a git command https://stackoverflow.com/questions/11693074/git-credential-cache-is-not-a-git-command

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值