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

后端 未结 5 1044
执笔经年
执笔经年 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 12:06

    Just complementing the answers:
    If you have tilde files with extension, like Sketchup, which creates backup files ending with "~.skp", then you need to add *~.skp in your .gitignore file. Or change skp for the extension of the software you are using. Or use *~.* if you are sure that all files ending with tilde with all extensions are safely to be ignored.

提交回复
热议问题