echo *.pyc >> .gitignore
這樣表示忽略pyc擴展名的的文件,這類文件git不用再去跟蹤了。 python
pyc
git status
看下效果,就會發現*.pyc文件沒有出如今untracked狀態中了。 git
*.pyc
untracked