Get git not to show untracked files

后端 未结 6 810
刺人心
刺人心 2020-12-23 20:16

When doing git commit, is there a way to not display the untracked files in my editor (defined in $EDITOR)? I know how to do so in the shell (

6条回答
  •  梦毁少年i
    2020-12-23 20:56

    You can temporary use the git commit option -uno to mask untracked files (git help commit).

    If you want a permanent solution use the .gitignore file.

    For instance, if you want to ignore the file bar.foo and any file with the .bak extension, you juste have to create a .gitignore file in the root directory of your project containing :

    bar.foo
    *.bak
    

    Some file are ignored by a global gitignore file (for instance, dot file and directory are ignored).

提交回复
热议问题