How to keep git from tracking all files that end with a “~”? February 13, 2023 by Tarik gitignore is the way to go. Just add *~ to .gitignore at the root of you repo.