git, don't show me *.pyc in the list of untracked files!

前端 未结 7 1069
执笔经年
执笔经年 2020-12-07 10:55

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.<

7条回答
  •  醉话见心
    2020-12-07 11:34

    Put in the file ~/.gitignore:

    *.pyc
    

    Run:

    git config --global core.excludesfile ~/.gitignore
    

    I agree with @David Wolever this option should be used with caution if ever.

    The ~/.gitignore ("%HOME%\.gitignore" on Windows) is just a convention you can use any filename you like e.g., "c:\docs\gitignore.txt".

提交回复
热议问题