Get git not to show untracked files

后端 未结 6 805
刺人心
刺人心 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条回答
  •  [愿得一人]
    2020-12-23 21:09

    If you don't ever want to commit them to your repo, use a .gitignore file to ignore them. More details can be found on the gitignore man page. They won't show up as untracked files when entering your commit message in your $EDITOR.

    If you simply don't want to see them when committing, set the Git config variable status.showUntrackedFiles to no, as noted here:

    $ git config --global status.showUntrackedFiles no
    

提交回复
热议问题