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?
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
.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.