简体   繁体   English

Windows git bash: git clone https://github.com/... results with fatal: working tree... already exists

[英]Windows git bash: git clone https://github.com/... results with fatal: working tree ... already exists

So I'm trying to clone a repo from here所以我试图从这里克隆一个回购

https://github.com/nglglhtr/getter-setter https://github.com/nglglhtr/getter-setter

I created a new folder FirstDapp and opened git gui here then opened git bash from there我创建了一个新文件夹 FirstDapp 并在此处打开 git gui 然后从那里打开 git bash

在此处输入图像描述

then I entered:然后我输入:

git clone https://github.com/nglglhtr/getter-setter

then the bash terminal said: fatal: working tree 'D/.../FirstDapp' already exists然后 bash 终端说:致命:工作树'D/.../FirstDapp'已经存在

so I tried the solutions from here:所以我尝试了这里的解决方案:

Exception "working tree already exists" while cloning GIT repo in pre-push hook 在预推送挂钩中克隆 GIT 存储库时出现异常“工作树已存在”

but those didn't work.但那些没有用。 Any ideas?有任何想法吗?

When you run:当你运行时:

git gui

the GUI will search for an existing Git repository in Git's usual fashion: GUI 将以 Git 的常用方式搜索现有的 Git 存储库:

  • Is there a repository here, in the current working directory?在当前工作目录中是否有存储库?
    • If so, that's it, and stop.如果是这样,就是这样,然后停止。
    • If not, try "climbing up one level", eg, from /path/to/current/dir , remove the /dir part leaving /path/to/current , and start over.如果没有,请尝试“爬上一层”,例如,从/path/to/current/dir删除/dir离开/path/to/current的部分,然后重新开始。

If this runs out of places to look, git gui opens a smaller, different-looking window and offers you a chance to clone or create a repository.如果没有地方可以查看, git gui打开一个更小、外观不同的 window,并为您提供克隆或创建存储库的机会。

(There are step I'm omitting on purpose here to simplify things, in that Git won't keep going after certain points, and under certain conditions, but these generally won't apply to your case.) (为了简化事情,我故意省略了一些步骤,因为 Git 在某些点和某些条件下不会继续执行,但这些通常不适用于您的情况。)

Since you did:既然你这样做了:

mkdir FirstDapp
cd FirstDapp

(or the Windows equivalent) and did not run a subsequent: (或 Windows 等效项)并且没有运行后续:

git init

there must not be a Git repository at the FirstDapp level, but Git-GUI found one, so there must be a Git repository at a higher level. FirstDapp层级一定没有Git存储库,但Git-GUI找到了,所以更高层级肯定Git存储库。 This is the repository that Git-GUI opened.这是 Git-GUI 打开的存储库。

To get around that problem, you should create—with git init or git clone —a repository within the FirstDapp directory:为了解决这个问题,你应该使用git initgit clone创建一个在FirstDapp目录中的存储库:

git clone https://github.com/nglglhtr/getter-setter

for instance.例如。 Then running git gui will find that repository.然后运行git gui将找到存储库。 If you create an empty one, you'll need to do all the remaining steps that git clone would do, so it will be easier to use git clone .如果创建一个空的,则需要执行git clone将执行的所有剩余步骤,因此使用git clone会更容易。

(As an aside, Git-GUI is not generally recommended. It's a bit of a toy example, rather than a real GUI. I personally dislike GUIs in the first place and will avoid them whenever I can, and recommend that you do the same, but tastes differ.) (顺便说一句,一般不推荐使用 Git-GUI。它只是一个玩具示例,而不是真正的 GUI。我个人首先不喜欢 GUI,并且会尽可能避免使用它们,并建议您也这样做,但口味不同。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows10 git clone https://github.com/ktbyers/netmiko” 致命错误 - Windows10 git clone https://github.com/ktbyers/netmiko&#8221 Fatal error 使用git bash下载lexandera / Aardwolf.git(Windows); 致命错误-无法连接到github.com - downloading lexandera/Aardwolf.git using git bash (Windows); fatal error - unable to connec to github.com 无法克隆https://github.com/doctrine/DoctrineFixturesBundle.git - Failed to clone https://github.com/doctrine/DoctrineFixturesBundle.git git 克隆致命:无法访问“https://github.com/snsnsjsn/allen.github.io/”:OpenSSL SSL_read:连接已重置,errno 10054 - git clone fatal: unable to access 'https://github.com/snsnsjsn/allen.github.io/': OpenSSL SSL_read: Connection was reset, errno 10054 git@github.com:...和https://github.com/...之间的区别? - Difference between git@github.com:… and https://github.com/…? 无法安装 pod(致命:无法访问 'https://github.com/CocoaPods/Specs.git/') - Cannot install a pod (fatal: unable to access 'https://github.com/CocoaPods/Specs.git/') 在 Colab 中将文件推送到 Git 时出错:致命:无法读取“https://github.com”的用户名:没有这样的设备或地址 - error when pushing files to Git in Colab: fatal: could not read Username for 'https://github.com': No such device or address 致命的:找不到存储库'https://github.com/user_name/first_app.git/' - fatal: repository 'https://github.com/user_name/first_app.git/' not found 致命:拒绝 git 凭据后,“https://github.com/myrepo/frontend/”的身份验证失败 - fatal: Authentication failed for 'https://github.com/myrepo/frontend/' After denying git credentials 是什么导致“致命:未找到存储库'https://github.com/bemyhre/my_web.git/'”错误 - What is causing “fatal: repository 'https://github.com/bemyhre/my_web.git/' not found” error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM