加入一个.gitignore 文件:
.idea/
venv/
*.pyc
*.pyo
这样会忽略 venv 文件夹下所有的文件,
venv/
venv/folder1
venv/folder2
venv/file1.py
venv/file2.py
我想忽略 venv 下但除了 folder2 子文件夹,该怎样写规则?谢谢!
1
willxiang 2015-12-12 14:55:34 +08:00 via iPhone
用感叹号。
搜一下用法,自己开个 project 建几个文件夹,写个测试 push 一下就明白了。 |
3
fds 2015-12-12 17:31:17 +08:00
有些蛋疼……虽然支持但也不建议这么用呀。
|
4
tanteng OP http://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder
# you can skip this first one if it is not already excluded by prior patterns !application/ application/* !application/language/ application/language/* !application/language/gr/ |