Removing swap files from your git project

git ls-files | grep '\.swo$' | xargs git rm -f

and

git ls-files | grep '\.swp$' | xargs git rm -f