我已将我的计算机恢复出厂设置,在此之前,我将我的 github 存储库从本地同步到远程。现在我试图添加一个本地存储库,它一直显示: This directory does not appear to be a git repository。所有存储库都这样做。我粘贴了 .gitattributes 文件,它们都在文件 github 中,并且创建了一个新的本地存储库。
这是我为我拥有的一个在线存储库创建一个新存储库并尝试将它们与 URL 链接后的样子:
它没有显示 URL 选项。发布不起作用,因为它已经存在于 GitHub 上。
最佳答案
您不应添加现有文件夹,而应将您的存储库克隆到一个新文件夹,并从该新克隆开始工作。
参见 GitHub Desktop cloning a repository .
但是,如果您想将您的现有 文件夹用作现有远程仓库的本地仓库,请遵循 desktop/desktop issue 2883
- Drag an ordinary folder into the app (or use Add Local Repository and choose the folder)
- You'll get a message saying "This directory does not appear to be a Git repository. Would you like to create a repository here instead?" and the "Add Repository" folder is disabled
- Click "create a repository here"
- Select the "Repository -> Repository Settings... -> Remote" option. Enter the URL of your remote repo.
关于git - 该目录似乎不是 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664169/