echo *.pyc >> .gitignore
这样表示忽略pyc扩展名的的文件,这类文件git不用再去跟踪了。 python
pyc
git status
看下效果,就会发现*.pyc文件没有出如今untracked状态中了。 git
*.pyc
untracked