0

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?

Dipam7
  • 63
  • 1
  • 6

2 Answers2

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
  • 4,797
  • 1
  • 19
  • 33
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,129,465
  • 480
  • 4,036
  • 4,755