【问题标题】:Cant use git in windows (Such file no such file or directory)不能在 Windows 中使用 git(这样的文件没有这样的文件或目录)
【发布时间】:2019-03-12 03:49:26
【问题描述】:

我试图在 Windows 上使用 git,但是当我想初始化本地 git 存储库时,我得到“这样的文件没有这样的文件或目录”。但这只发生在某些目录上,如果我尝试从下载中使用它,例如我可以使用它,我也不能克隆存储库。

$ git init
C:/Users/casas/Desktop/.git: No such file or directory

我不知道发生了什么事可以帮助我吗?

【问题讨论】:

    标签: windows git github


    【解决方案1】:

    首先,不要尝试在 Desktop 中创建 Git 存储库:这不是存储项目源代码的好地方。

    其次,检查你是不是using powershell and a mount drive
    或者检查你是不是using SourceTree

    尝试改用常规 CMD 和 git init myrepo:这将创建一个 myrepo 文件夹(其中包含 .git

    确保使用latest Git for Windows 2.21

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-28
      • 2021-05-01
      • 2015-07-29
      • 1970-01-01
      • 2021-06-24
      • 2015-02-20
      相关资源
      最近更新 更多