简体   繁体   中英

How to gitignore sub-directories under parent folder?

I have the following structure:

FolderA
-FolderB
--FolderB1
---FileB1
---FileB2
--FolderC
---FolderC1
----FileC1

Suppose if I am working under FolderC1 and wanted to gitignore Folder B and below contents?

When I give git status in the FolderC1. It shows all changes under FolderB also which I don't want

Simply add a path to git status :

cd FolderA/FolderB/FolderC
git status .

That will show you changes only from the current folder ( C ) and below.
That has nothing to do with "gitignore", which would prevent elements of other folders to be tracked.

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