Whenever I try to commit code I get a message:
Found a swap file by the name "/tmp/.commit-message.swp"
git rm /tmp/.commit-message.swp
fatal: '/tmp/.commit-message.swp' is outside repository
This means your
tmp folder is not inside your git project. You can just remove your file by the usual
rm command without using git.
Maybe check that you are in the right project, or add this folder to your project first (then remove the file).