Whenever I use 'git add X' and then when I run git status it shows the file is in the staging area but there's an untracked file named 'X~'. Why does this happen and what exactly does it mean?
Asked
Active
Viewed 91 times
2 Answers
2
Some text editors (for example, gedit) make backup copies of files you edit. They save them under name <original-file-name>~
.
You have two options:
1) configure your editor not to save backup copies, or
2) add line *~
to the file .gitignore
.

Oleg Andriyanov
- 5,069
- 1
- 22
- 36
0
It can be left as a backup file by a text editor.
You can add *~
to your .gitignore
, in order for git status
to ignore those files.

VonC
- 1,262,500
- 529
- 4,410
- 5,250