The tilde suffix on file names is usually used by editors (Emacs, Vim in some modes/versions) on backup copies of files you edit. At one time on Mac, Vim seemed to create backups for me; it doesn't any more, but I'm not sure now whether that's because I tweaked a setting somewhere or whether vim changed its behaviour.
I have not seen git add tilde suffixes to file names (either on a Mac where I work mainly, or anywhere else).
To stop git wanting to add the files, add a line containing just *~
to .gitignore
.
Vim has (at least) three settings related to this:
nobackup
backupcopy=auto
backupext=~
My ':set all
' shows the values above. Yours probably shows 'backup
' rather than 'nobackup
'.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…