"> .gitignore下面制定了*.pyc但是无效?-PHP Chinese Network Q&A
.gitignore下面制定了*.pyc但是无效?
巴扎黑
巴扎黑 2016-11-09 16:14:51
0
1
785

我在git的根目录下面新建了一个.gitignore文件,然后添加了以下的内容

# Byte-compiled / optimized / DLL files__pycache__/
*.py[cod]

但是如果我现在修改了一个.py文件,编译后用git status查看

Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified: views.py
modified: views.pycno changes added to commit (use "git add" and/or "git commit -a")

请问应该怎么解决这个问题,让git忽视.pyc文件的修改


巴扎黑
巴扎黑

reply all (1)
phpcn_u29

忽略已提交到版本的文件
1.git rm -r --cached file_name/dir
2.添加到.gitignore中
3.提交、推送

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!