4

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...".

How should I add a git repository to the git-windows-interface?

thanks

Totty.js
  • 15,563
  • 31
  • 103
  • 175

3 Answers3

0

You can try and make GitHub for Windows detect your repo, by modifying the local path(s) it scans.
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).

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).
Then a local scan will detect it.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • How do I modify the local paths it scans? I only have the "default storage location", if I change this, the next repositories I will add will be added into the submodule location, which is specific for a project, so it's bad. I don't want to copy into the "%HOME%\My Documents" my sub repo because it's part of the application I'm using, so it will break the app if I remove from there... – Totty.js Jan 22 '13 at 12:28
  • @Totty you need to copy it to "`%HOME%\My Documents`". You can edit the path of that submodule in your parent repo (http://stackoverflow.com/a/914090/6309). – VonC Jan 22 '13 at 13:22
  • I have for example a qooxdoo app that should stay in the folder "myapp/lib", if I move to "my documents" the qooxdoo engine cannot render the app.. – Totty.js Jan 22 '13 at 14:34
  • @Totty you wouldn't move it: you would copy a clone, and then reference that clone as the source of your submodule. But your submodule would still be checked out in `myapp/lib/qooxdo`. It is just that it would refer to the `qooxdo` under `%HOME%\My Documents` (which, in turn, can refer to the actual remote repo for `qooxdo`). Convoluted, but possible. I am just trying to get around the fact it doesn't seem possible right now for GitHub for Windows to scan any path, and to import any directory, especially when that directory is itself within a parent git repo (as submodules are). – VonC Jan 22 '13 at 15:35
0

I was getting the same error. I had been trying to drag in the hidden .Git folder. Instead, drag in the folder above, which contains the .Git folder.

Mark Maslar
  • 1,121
  • 4
  • 16
  • 28
  • k. perhaps my cause of error was different. With a structure like this: .....Visual Studio 2010\Projects\MyProject\.git dragging in the MyProject folder fixed the problem. – Mark Maslar Feb 12 '13 at 02:11
0

This worked for me:

  1. Rename the ".git" folder to ".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.
  3. Close github for windows, delete the new .git folder and rename the old one back to ".git"
  4. Open github for windows again, and it will see the old ".git" folder.
apple16
  • 1,137
  • 10
  • 13