I want to ignore all files and folders except five folders that begin with a certain prefix. For example
I want to ignore everything except folders 3 and 4 and their content
I tried this but it didn't work
*
!.gitignore
!/prefix_*
I also tried writing the full names of folder 3 and 4 but it didn't work either. git status
tells me that there are no files to commit.
This will ignore all root files and root sub-directories, excluding the .gitignore file and the directories with the prefix prefix_
/*
/*/
!.gitignore
!/prefix_*
Git should now track the files in the directories with prefix_
and ignore the rest.
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.