stdin:通过 ssh 运行“git Push”时不是 tty - github

问题描述 投票:0回答:3

我在 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 trace git-lfs: pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF

ssh git-lfs
3个回答
2
投票

感谢@torek,他给了我一种获取更详细的调试日志的方法

GIT_TRACE=1 git push

这已将问题范围缩小到来自 Git-LFS,而不是来自 GIT/Github/GitBash。

我已经通过运行修复了它:

git lfs update --force
正常
update
返回时出现冲突错误


1
投票

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

解决方案:

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

0
投票

我最近在使用 husky 运行预推钩子时遇到了这个问题, 对我有用的是重定向标准输入、输出和错误流
到 < /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
© www.soinside.com 2019 - 2024. All rights reserved.