4

I have a folder containing a repository I am working on. In my repo, I have a file called README.md, as most repos do.

However, randomly, Ubuntu creates a file called README.md~, which gets pushed up to my repository on github in my next push. Then in my public repo I have two README files, which is slightly confusing and strange.

Why is this happening and how do I stop this?

1 Answers1

9

The *~ files are backup files of your editor.

Open or create an ignore file .gitignore in the root of your project folder and add the line *~ which means: Ignore all files which filename ends with a ~

echo "*~" >> .gitignore
A.B.
  • 90,397