Git Push origin master 返回错误无法生成...为什么?

发布于 2024-09-07 00:00:23 字数 842 浏览 8 评论 0 原文

我是第一次尝试使用 GitHub,但在尝试正确进行身份验证后遇到了许多问题,我成功地使用 [email protected] 并创建了一个存储库,但是当我尝试“git Push origin master”时,出现以下错误:

$ git push origin master
error: cannot spawn : No such file or directory
fatal: unable to fork

我找不到任何错误原因或任何解释在故障排除页面中,任何人都可以建议为什么我会收到该错误。

我已经指定/添加了远程路径,如下所示:

$ git remote add origin [email protected]:christopherdebeer/yUML-Diagram.git

请帮忙。

这也是在运行 mysysgit (1.7.0.2) 并使用 git bash 的 Windows 7 机器上完成的。

回复:问题 313,GIT_SSH 变量中的空格,不能是我的问题如下:

$GIT_SSH="c:/putty/plink.exe"

I'm trying to use GitHub for the first time, but after many issues trying to get the authentication right, I've managed to authenticate with [email protected] and created a repo, but when i try "git push origin master" i get the following error:

$ git push origin master
error: cannot spawn : No such file or directory
fatal: unable to fork

I cant find any reason for the error or any explanation in the trouble shooting pages, can anyone suggest why it may be that I get that error.

I have already specified/added the remote path as follows:

$ git remote add origin [email protected]:christopherdebeer/yUML-Diagram.git

please help.

Also this is all on a windows 7 machine running mysysgit (1.7.0.2) and using git bash.

re: Issue 313, a space in the GIT_SSH variable, cant be the problem mine is as follows:

$GIT_SSH="c:/putty/plink.exe"

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

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

发布评论

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

评论(6

留蓝 2024-09-14 00:00:23

这让我想起了问题 313,其中 GIT_SSH 环境变量的路径中包含空格。

除此之外,您是否按照 GitHub 帮助页面 操作并检查您的 ssh 连接是否正确工作了吗?

$ ssh [email protected]
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.

That reminds me of issue 313, where GIT_SSH environment variable contains spaces in its path.

Other than that, did you followed the GitHub Help page and checking if your ssh connection worked?

$ ssh [email protected]
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
两相知 2024-09-14 00:00:23

我不确定这是否只是我自己的愚蠢,但我已经解决了这个问题......
这就是我所做的(来自同事的建议):

我试图将本地存储库中的更改推送到 github 上的空存储库...

我应该做的是克隆空存储库,将文件本地添加到我的克隆中存储库,添加文件,提交添加,然后推送到 github 存储库...

$ git clone [email protected]:christopherdebeer/yUML-Diagram.git
 // added files
$ git add *
$ git commit -m "first commit locally"
$ git push origin master

我最初的问题可能是由于我对 git 使用的完全天真...

I'm not sure if it was just stupid of myself, but I've solved the problem...
Here's what I did (from advice, from work colleagues):

I was attempting to push changes in a local repo to an empty repo on github...

what i should have done was clone the empty repo, add the files locally to my cloned repo, added the files, commited the adds, and THEN push to the github repo...

$ git clone [email protected]:christopherdebeer/yUML-Diagram.git
 // added files
$ git add *
$ git commit -m "first commit locally"
$ git push origin master

My original problems might have been due to my totaly naivety as to gits usage...

迷途知返 2024-09-14 00:00:23

我不确定这是否只是 smartgit 问题,但当这种情况发生在该程序中时,它实际上是临时文件夹上的权限问题。 Windows 7 和 8 似乎偶尔会重置临时目录的权限,您需要将它们更改回完全读写权限。

I'm not sure if this is only a smartgit issue, but when this happens in that program its actually a permissions issue on the temp folder. It seems like windows 7 and 8 occasionally reset the permissions on the temp directory and you need to change them back to full read and write perms.

把人绕傻吧 2024-09-14 00:00:23

我有同样的问题。
我将远程链接从:更改

[email protected]:Prathapnagaraj/trydjango18.git

为 url-link:

https://github.com/Prathapnagaraj/trydjango18

然后它工作正常。

I had same problem.
I changed my remote link from:

[email protected]:Prathapnagaraj/trydjango18.git

to url-link:

https://github.com/Prathapnagaraj/trydjango18

then it worked fine.

烈酒灼喉 2024-09-14 00:00:23

先拉,再推。似乎有时您的本地存储库会变得“陈旧”。当我一周左右没有推送或拉动任何东西时,我需要拉动(即使没有任何变化,因为我是唯一一个在该仓库上工作的人)。

Do a pull first, before pushing. It seems that sometimes your local repo gets "stale". When I don't push or pull anything for a week or so, I need to pull (even though there are no changes, since I'm the only one working on that repo).

静水深流 2024-09-14 00:00:23

我有同样的问题。我尝试过的一些调试步骤:

  • ssh -T [email protected] 工作正常
  • GIT_SSH 为空,就像在另一台机器上该命令工作正常一样,
  • 此时 gitconfig 的 sshCommand 并不重要;错误发生在读取之前
  • 我无法使用/尝试 https 远程 url,因为它已被远程禁用
  • git remote remove origin && git remote add origin git@ 没有解决问题
  • 事实上,同一台机器上的另一个存储库可以很好地拉取,表明这个问题是在本地 >.git 文件夹

我用本地状态推送了所有分支,备份了一些未跟踪的文件,删除了整个存储库目录并再次克隆。从那时起,一切都按其应有的方式工作

I had the same issue. Some debugging steps that I tried:

  • ssh -T [email protected] works fine
  • GIT_SSH is empty, just like on another machine where the command works fine
  • gitconfig's sshCommand doesn't matter at this point; the error occurs before that is read
  • I can't use/try the https remote url, as it's disabled remotely
  • git remote remove origin && git remote add origin git@<repository> didn't resolve the issue
  • In fact, another repository on the same machine can pull just fine, indicating this issue is within the local .git folder

I pushed all my branches with local state, backed up some untracked files, deleted the whole repository directory and cloned again. From then on everything worked as it should ????

My best guess as the what was going on is corruption somewhere in the .git folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文