简体   繁体   中英

Git Bash for Windows not showing all directories

I'm running Windows 10.0.19043. I have the latest version of Git Bash. I'm trying to push a local repository to Github, but when I cd to the repository's root directory in Git Bash and run ls , the only child directory that comes up is node_modules ( public and src are missing)

When I use the file explorer to navigate to the same project root, public and src are clearly there, along with all of their contents.

Additionally, I have many directories on my Desktop, but when I use ls from Git Bash at the Desktop, this particular project folder is the only one that it displays.

Any idea what could be causing this? Please let me know if more information is needed.

Windows restricts access to certain directories, such as the Documents folder, to most programs unless they have access and request it. This means that programs like Git won't have access to all the files and directories under those folders.

As a result, you should avoid placing Git repositories under the Desktop, Documents, Music, or other similar folders. In addition, you should never store Git repositories under a directory managed by a cloud syncing service, such as Dropbox or OneDrive, since this can cause missing data or other data loss. Since those folders are often managed by these sorts of programs (if you're using them), this is another reason to avoid them.

You're probably better moving your repositories into your home directory (eg, under C:\Users\<username> ), and then things will probably work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM