admin管理员组

文章数量:1289556

I need a gitignore that ignores basically all folders with a few exceptions. I have 4 folders that needs to be sync with git 3 of them start like this :

RCU*/

And another folder named Tools. For example :

I need to ignore all folders except :

  • RCUFromUR
  • RCUToB360
  • RCUToUR
  • Tools

Every other folders than these needs to be ignored (and other folders will be added), is there a way to achieve this ?

Thanks

I need a gitignore that ignores basically all folders with a few exceptions. I have 4 folders that needs to be sync with git 3 of them start like this :

RCU*/

And another folder named Tools. For example :

I need to ignore all folders except :

  • RCUFromUR
  • RCUToB360
  • RCUToUR
  • Tools

Every other folders than these needs to be ignored (and other folders will be added), is there a way to achieve this ?

Thanks

Share Improve this question asked Feb 20 at 16:20 Emile DadouEmile Dadou 5544 silver badges25 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2
# Ignore all directories except specific ones
/*
!/RCUFromUR/
!/RCUToB360/
!/RCUToUR/
!/Tools/

# If you want to exclude subdirectories from being tracked under the above folders, you can add these
!/RCUFromUR/*/
!/RCUToB360/*/
!/RCUToUR/*/
!/Tools/*/

本文标签: gitgitignoreignore folders that doesn39t respect a specific maskStack Overflow