stdin: 运行“git push”时不是 tty; - 通过 ssh 访问 github
我在 Windows 上使用 Git,直到最近一切都工作正常。
在过去的几天里,我在尝试将本地分支推送到 GitHub 上的远程时遇到错误。我正在通过 SSH 连接到 GitHub。我收到的错误是,
stdin is not a tty
error: failed to push some refs to 'github.com:xxx/yyy.git'
无论我尝试推送新分支(没有远程分支)还是现有分支,都会发生这种情况。这两个命令都以同样的方式失败:
git push
git push -u origin tomasz/test
所有其他 git 命令似乎都工作正常,即 git pull 、 fetch 等。
过去几天我一直在谷歌搜索但找不到任何可以修复它的东西
更新 1: 我尝试了通过运行 pull --rebase ...
提出的解决方案之一,结果如下:
更新:2 Git Trace 失败的 ssh 协议连接给出错误 14:49:50.463468跟踪git-lfs:纯SSH协议连接失败:无法与远程端协商版本(无法读取功能):EOF
I am using Git on Windows and everything was working fine till recently.
In the last few days I have been getting an error when trying to push my local branch to remote on GitHub. I am connecting to GitHub via SSH. The error that I'm getting is
stdin is not a tty
error: failed to push some refs to 'github.com:xxx/yyy.git'
This happens regardless whether I try to push a new branch (without a remote) or an existing one. Both of those commands fail in the same way:
git push
git push -u origin tomasz/test
all other git commands seem to be working fine, i.e. git pull
, fetch
etc.
I have been googling for the last few days but couldn't find anything that would fix it
Update 1:
I tried one of the solutions proposed by running pull --rebase ...
, this is the outcome:
Update:2
Git Trace failed ssh protocol connection gives error14:49:50.463468 trace git-lfs: pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感谢 @torek,他给了我一种获取更详细调试日志的方法
GIT_TRACE=1 git push
这已将问题范围缩小到来自 Git-LFS,而不是来自 GIT/Github/GitBash。
我已经通过运行修复了它:
git lfs update --force
正常update
返回时出现冲突错误thank you to @torek who gave me a way to get more detailed debugging logs
GIT_TRACE=1 git push
This has narrowed down the issue to be from Git-LFS, instead of GIT/Github/GitBash.
I have fixed it by running:
git lfs update --force
as normalupdate
was coming back with conflict errors原因:
在GitHub中,该文件不在本地仓库中。
解决方案:
Reason:
in GitHub, the file is not in the local warehouse.
Solutions:
最近,我在与Husky一起经营前挂钩时遇到了这个问题
对我有用的是重定向标准输入,输出和错误流
到< /dev/tty
有时,这会欺骗应用程序的行为,好像它们在TTY中运行一样:
我的PER PUSH脚本的代码现在看起来像这样:
I recently faced this issue when running a pre-push hook with husky,
and what worked for me was redirecting standard input, output, and error streams
to < /dev/tty
This can sometimes trick applications into behaving as though they're running in a TTY:
The code for my pre-push script is looking like this now: