I used git to commit changes in my repository,
followed these steps
git add .
git commit -m "message"
but noticed a clone of the file where changes were made also present in the repository
new file had ‘~‘ symbol appended at the end.
why did this happen ? And how can I prevent it in the future ?
Also some thoughts on how to remove the file with “~” would be great
Thanks
Your editor is generating backup files of the form FILENAME~. (Emacs does this; it can be persuaded otherwise.) You have not asked git to ignore files ending in ~. With
git add .you’re telling git to add everything that you haven’t asked it to ignore.See also:
gitignore