gpt4 book ai didi

git clone 失败,错误为 "--stdin requires a git repository"

转载 作者:行者123 更新时间:2023-12-04 10:48:07 24 4
gpt4 key购买 nike

我对这个问题感到困惑,并被困在这里,不知道为什么会发生。

我正在使用 git clone 从 bitbucket 获取我的 repo,例如“git clone git@bitbucket.org:mycompny/therepo.git”

但是,我失败了,例如:

fatal: --stdin requires a git repository
fatal: index-pack failed

最佳答案

您可以看到错误消息 introduced in 2016 here :

The index-pack builtin is marked as RUN_SETUP_GENTLY, because it's perfectly fine to index a pack in the filesystem outside of any repository.
However, --stdin mode will write the result to the object database, which does not make sense outside of a repository. Doing so creates a bogus ".git" directory with nothing in it except the newly-created pack and its index.



报错的原因是当前文件夹不是git目录。

检查您当前的文件夹,并确保其路径是现有的。

在这里,根本原因是使用 Cygwin,而不是 Git For Windows 中包含的 git bash .

OP yunfei添加 in the comments :

If I use the git included from my "git bash", by exporting it into my environment in cygwin, I can make it work from cygwin as well.

Just do export PATH="/cygdrive/c/Program Files/Git/cmd":$PATH



Cygwin 必须包含与来自 2.21 in the Cygwin package list 的其他组件不兼容的 Git 版本 ( Git for Windows ) :使用 git.exe来自 Git for Windows 更安全。

关于git clone 失败,错误为 "--stdin requires a git repository",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59606279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com