$ git push warning: push.default 尚未设置,它的默认值在 Git 2.0 已从 'matching' 变更为 'simple'。若要不再显示本信息并保持传统习惯,进行如

xiaoxiao2021-02-28  63

刚才使用git push报错

【$ git push warning: push.default 尚未设置,它的默认值在 Git 2.0 已从 'matching' 变更为 'simple'。若要不再显示本信息并保持传统习惯,进行如下设置:   git config --global push.default matching 若要不再显示本信息并从现在开始采用新的使用习惯,设置:   git config --global push.default simple 当 push.default 设置为 'matching' 后,git 将推送和远程同名的所有 本地分支。 从 Git 2.0 开始,Git 默认采用更为保守的 'simple' 模式,只推送当前 分支到远程关联的同名分支,即 'git push' 推送当前分支。 参见 'git help config' 并查找 'push.default' 以获取更多信息。 ('simple' 模式由 Git 1.7.11 版本引入。如果您有时要使用老版本的 Git, 为保持兼容,请用 'current' 代替 'simple') sign_and_send_pubkey: signing failed: agent refused operation Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 】

Stack Overflow找到解决方案:

https://stackoverflow.com/questions/30068298/git-fatal-could-not-read-from-remote-repository-please-make-sure-you-have-th

git remote set-url origin https://github.com/<user_name>/<repo_name>.git 】

不足之处就是,以后每次push都要输入github的用户名和密码。暂时没有找到合适的解决方案,先凑合着吧。

转载请注明原文地址: https://www.6miu.com/read-76409.html

最新回复(0)