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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With