简体   繁体   English

当我尝试拖放包含git存储库(此时是子模块)的文件夹时,它会显示“无法将文件夹放到此处......”

[英]When I try to drag and drop a folder which contains a git repository (which is a submodule at the moment) it says “Can't drop folder here…”

In the git-windows-interface when I drag and drop a repository it says: "Can't drop folder, You can only drop one folder without git repository with the app at this time. Dropping a single folder will allow you create a new Git repository in that location...". 在git-windows-interface中,当我拖放存储库时,它说:“无法删除文件夹,此时您只能删除一个没有git存储库的文件夹。删除单个文件夹将允许您创建一个新文件夹那个位置的Git存储库......“。

How should I add a git repository to the git-windows-interface? 我应该如何将git存储库添加到git-windows-interface?

thanks 谢谢

You can try and make GitHub for Windows detect your repo, by modifying the local path(s) it scans. 您可以尝试通过修改扫描的本地路径,使GitHub for Windows检测您的仓库。
That would avoid trying that "drag and drop feature" which might not work in your case (being a submodule, which is by nature a nested git repo). 这样可以避免尝试那种在您的情况下可能无效的“拖放功能”(作为子模块,本质上是一个嵌套的 git repo)。

If it isn't possible to change that path, at least try and copy that repo in %HOME%\\My Documents (HOME being set by the portable git within GitHub for Windows, C:\\User\\login on W7+, C:\\Document and Settings\\Login on WXp). 如果无法更改该路径,请至少在%HOME%\\My Documents复制该repo(HOME由GitHub for Windows中的便携式git设置, C:\\User\\login on W7 +, C:\\Document and Settings\\Login WXp)。
Then a local scan will detect it. 然后本地扫描将检测到它。

I was getting the same error. 我得到了同样的错误。 I had been trying to drag in the hidden .Git folder. 我一直试图拖动隐藏的.Git文件夹。 Instead, drag in the folder above, which contains the .Git folder. 而是拖动上面的文件夹,其中包含.Git文件夹。

This worked for me: 这对我有用:

  1. Rename the ".git" folder to ".git_back" 将“.git”文件夹重命名为“.git_back”
  2. Create a new git repo in the same folder so the new ".git" folder is in the same folder as the old one. 在同一文件夹中创建一个新的git仓库,以便新的“.git”文件夹与旧文件夹位于同一文件夹中。
  3. Close github for windows, delete the new .git folder and rename the old one back to ".git" 关闭windows的github,删除新的.git文件夹并将旧文件重命名为“.git”
  4. Open github for windows again, and it will see the old ".git" folder. 再次打开windows的github,它会看到旧的“.git”文件夹。

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

相关问题 使用键盘拖放文件夹 windows 11 - drag or drop folder using keyboard on windows 11 如何删除一个不容易完成的文件夹? - How can I delete a folder which it can't be done easily? 如何在 Windows 中的 git-bash 中执行位于带有空格的文件夹(即“程序文件”)中的命令? - How can I execute commands in git-bash in Windows which are located in a folder with spaces ie “Program Files”? 是否可以使用CFSTR_FILEDESCRIPTOR拖放创建文件夹? - Is it possible to create a folder using CFSTR_FILEDESCRIPTOR drag and drop? 从“发送到”菜单调用程序时,如何确定用户正在浏览的文件夹? - How can I determine which folder the user was browsing when my program was invoked from the “sent to” menu? 将文件夹设置为符号链接和git子模块 - Make a folder both a symlink and a git submodule 我可以在 Windows 中压缩与 AWS Lambda 兼容的文件夹吗? - Can I compress a folder in Windows which will be compatible in AWS Lambda? 我想创建一个文件夹,用户可以在其中删除文件,但不能删除文件 - I want to make a folder where users can drop files but not delete them 以管理员身份运行时无法在 Discord 上拖放文件 - Can't drag and drop files on Discord while running it as administrator Git:克隆包含自身的存储库(将自身添加为子模块) - Git: Clone repository that contains itself (adds itself as submodule)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM