haydenull / logseq-plugin-git

A git plugin for logseq
MIT License
115 stars 24 forks source link

commit&push时出现“Git push failed fatal: could not read Username for 'https://gitee.com': Device not configured”,在文件夹里手动push却能成功,请问可能是什么问题呢? #43

Open jackyan0715 opened 1 year ago

jackyan0715 commented 1 year ago

commit&push时出现“Git push failed fatal: could not read Username for 'https://gitee.com': Device not configured”,在文件夹里手动push却能成功,请问可能是什么问题呢?

howie-serious commented 11 months ago

我也是同样的问题。想不明白怎么回事。现在都是靠在iterm里面手动push。

hswsp commented 11 months ago

+1,求解决方案!Looking for solutions!

hswsp commented 11 months ago

目前找到一个貌似可行的方案:

  1. 设置credential.helper: git config --global credential.helper store
  2. 此时可以push了,但是国内命令行push会被443 cannot connect。用各位的手段保证命令行能提交就行了。比如:
    1. 梯子
    2. 解决缓存污染:完美优化Github访问缓慢问题 或者 解决DNS污染问题,例如github访问慢,无法clone,微软账户登录慢等

另一个同样的issue也有解决方案:issue #17

GOWxx commented 10 months ago

参考 https://github.com/haydenull/logseq-plugin-git/issues/17#issuecomment-1493327019

准备令牌,使用 ssh 连接,可以设置库的上游。

git remote set-url origin https://[token]@github.com/[username]/[repo_name].git

不同的系统使用令牌的方式不同,参照 GitHub 文档。

Generating a new SSH key and adding it to the ssh-agent 生成新的 SSH 密钥并将其添加到 ssh-agent