question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected 'This folder contains files. Git can only clone to empty folders.' error

See original GitHub issue

Describe 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

  1. Go to the GitHub Desktop
  2. Click on ‘Add’ -> ‘Clone repository…’
  3. Start typing something in search (to search through your available repositories)
  4. 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

image

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:closed
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
M4N0JKUM4Rcommented, Jun 27, 2021

Did you solve this?

9reactions
arti1117commented, Apr 8, 2022

I solved this issue by deleting the directory in the local path.

check your path

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found