问题描述
在做: > git status
它显示未跟踪文件下的大型.pyc文件列表。我不希望它显示这些,因为它增加了噪音。
换句话说,我该如何让git忽略.pyc文件以及所有项目?
编辑
我并没有要求传播我的方式忽略文件给其他人,我真的只是说对于所有项目,这意味着我不想配置每个新项目来忽略.pyc文件。
UPDATE
我应该补充一点,我正在使用Windows,而我的git是
是.gitconfig文件还是文件夹?我的家目录中没有这样的东西( C:\ users \< myusername> \
)
UPDATE2
感谢大家的回应,
我使用以下方法解决了这些问题:
> git config --global core.excludesfile c:\ git \ignore_files.txt
并将* .pyc放入 c:\ git \ignore_files中。 txt
git config --global core.excludesfile c:\程序文件\whatever\global_ignore.txt
然后, p>
*。foo
到该文件。
When doing:
>git status
It shows a big list of .pyc files under "untracked files". I don't want it to show these, as it adds noise.
In other words, how do I make git ignore .pyc files all the time and for all projects?
EDIT
I'm not asking for a way to spread my ignored files to other people, I really just mean "for all projects", meaning I don't want to configure each new project to ignore .pyc files.
UPDATE
I should add that I'm working on windows, and my git is msysgit
Is .gitconfig a file or a folder? I don't have such a thing in my home directory (C:\users\<myusername>\
)
UPDATE2
Thanks everybody for the responses,
I solved the issues by using:
>git config --global core.excludesfile c:\git\ignore_files.txt
and putting *.pyc in c:\git\ignore_files.txt
git config --global core.excludesfile "c:\program files\whatever\global_ignore.txt"
Then, add
*.foo
to that file.
这篇关于git,不要在未跟踪的文件列表中显示* .pyc!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!