How to keep git from tracking all files that end with a “~”?

后端 未结 5 1079
执笔经年
执笔经年 2020-12-24 11:16

I\'m using Gedit, and each time I save a file, Gedit creates a copy of it, and the name of the copy always ends with a ~. The problem is, Git always tries to track these fil

5条回答
  •  心在旅途
    2020-12-24 11:55

    Why bother adding a .gitignore file when you can edit the plaintext file .git/info/exclude. "When deciding whether to ignore a path, git normally checks gitignore patterns from multiple sources" https://www.kernel.org/pub/software/scm/git/docs/gitignore.html

    If you add *~ to a line in the .git/info/exclude file in your git repository. Git will ignore that pattern and all of the files ending in tildes.

提交回复
热议问题