stdin: 运行“git push”时不是 tty; - 通过 ssh 访问 github

发布于 2025-01-18 03:20:38 字数 1003 浏览 0 评论 0原文

我在 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

enter image description here

Update 1:
I tried one of the solutions proposed by running pull --rebase ..., this is the outcome:
enter image description here

Update:2
Git Trace failed ssh protocol connection gives error
14:49:50.463468 trace git-lfs: pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绝不放开 2025-01-25 03:20:38

感谢 @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 normal update was coming back with conflict errors

白云悠悠 2025-01-25 03:20:38

原因:
在GitHub中,该文件不在本地仓库中。

解决方案:

git pull --rebase origin tomasz/test
git push -u origin tomasz/test

Reason:
in GitHub, the file is not in the local warehouse.

Solutions:

git pull --rebase origin tomasz/test
git push -u origin tomasz/test
折戟 2025-01-25 03:20:38

最近,我在与Husky一起经营前挂钩时遇到了这个问题
对我有用的是重定向标准输入,输出和错误流
到< /dev/tty
有时,这会欺骗应用程序的行为,好像它们在TTY中运行一样:
我的PER PUSH脚本的代码现在看起来像这样:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn test < /dev/tty

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:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn test < /dev/tty
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文