Repository navigation
Having problems understanding the ignore setup. #4916
|
Current version running on windows 10 x64 The current setup should ignore everything except python files. but that would be ignored and python files in the root are tracked by the wrong rule What am I missing? |
Replies: 2 comments
|
*
!*/
!*.py
!.gitignore
|
|
Does it - thank you very much |
*also ignoresabc/itself. Git cannot re-includeabc/xyz.pywhile its parent directory remains ignored. Use:!*/keeps directories traversable, and the slashless!*.pymatches Python files at any depth, so!**/*.pyis redundant. The final line lets you commit.gitignoreitself. Also,git check-ignore -v xyz.pyshowing a rule beginning with!meansxyz.pyis not ignored; the last matching rule wins. I reproduced both results with your original rules using Git for Windows 2.44.0.windows.1, then verified that this replacement leaves root and nested.pyfiles untracked while a nested.txtstays ignored.