Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git repository folder does not appear in File Explorer

Using GitHub Dekstop, I cloned one of my own repositories to my computer, and I named the folder repo:

C:\Users\Lenovo\Desktop\DevFiles\repo

Now if I navigate to the parent folder DevFiles, the repository folder repo is not visible.

But if I just paste C:\Users\Lenovo\Desktop\DevFiles\repo into the URL bar, the folder opens like normal.

Why might this be?

like image 552
Aryan Beezadhur Avatar asked Jun 28 '20 19:06

Aryan Beezadhur


People also ask

Why can't I see my .git folder?

The . git folder is hidden to prevent accidental deletion or modification of the folder. The version history of the code base will be lost if this folder is deleted. This means, we will not be able to rollback changes made to the code in future.

Where is my git repository folder?

git directory is a configuration file for git. Use the terminal to display the . git directory with the command ls -a . The ls command lists the current directory contents and by default will not show hidden files.

How do I make a .git folder visible?

If git inited, added and committed the folder with no problem then there is a . git folder there. If you can't see it in Windows Explorer then you need to enable the showing of hidden and system files and folders in Windows Explorer. The free eBook "Pro Git" is really helpful for getting up to speed with git.


1 Answers

This is a problem caused by onedrive.

On my Windows PC, OneDrive, which creates a backup of every file on the system, was active. I was trying to access the repo from

C:\Users\Lenovo\OneDrive\Desktop\DevFiles\repo

which is where File Explorer will go by default if I search for DevFiles.

GitHub Desktop had stored the repo in

C:\Users\Lenovo\Desktop\DevFiles\repo

Not in the \OneDrive\ folder.

This is extremely confusing, especially since cloning more repositories had the same problem.

like image 178
Aryan Beezadhur Avatar answered Nov 15 '22 02:11

Aryan Beezadhur