Unexpected 'This folder contains files. Git can only clone to empty folders.' error
See original GitHub issueDescribe the bug
On repo search error “This folder contains files. Git can only clone to empty folders.” is shown, but no folder is selected yet
Version & OS
Version 2.6.1 macOS 11.1 (20C69)
Steps to reproduce the behavior
- Go to the GitHub Desktop
- Click on ‘Add’ -> ‘Clone repository…’
- Start typing something in search (to search through your available repositories)
- See error at the top (screenshot attached)
Expected behaviour
Error is shown when some folder is selected
Actual behaviour
Error is shown when searching, no folder was selected yet
Screenshots
Additional context
I have previously selected custom folder, not using the default in Documents. Already cloned several repos there. This error doesn’t affect behaviour anyhow, new repos can be cloned without any problems. I assume there’s some bug in the logic if showing this error.
My main folder is: ~/Projects
and it’s selected, when I click a repo in the list to clone, it automatically changes to ~/Projects/my-project
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
"this folder contains files git can only clone to empty ... - Reddit
You can do it just by creating a new folder at any desired path/location in your pc then make sure to provide the...
Read more >How do I clone into a non-empty directory? - Stack Overflow
Clone just the repository's .git folder (excluding files as they are already in # `existing-dir`) into an empty temporary directory git ...
Read more >Why can't we create empty folders and move files to ... - Quora
Well, you can't create an empty folder because that isn't a concept that means anything in Git. Git doesn't track folders, it tracks...
Read more >How to Clone into a Non-Empty Git Directory - W3docs
Getting to the directory to clone. Firstly, get to the existing directory: cd my/folder/ ; Setting up a repository. Create a new repository...
Read more >Get up to speed with partial clone and shallow clone
This is only fully realizable if you have all reachable data in your local ... every version of every file in the entire...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did you solve this?
I solved this issue by deleting the directory in the local path.