How to stop pushing your swap files
I'm an avid vim user. I'm not ashamed to admit it. But I don't really need everyone to know. If you are a vim and tmux user, you know that sometimes you push your changes while a vim process is still open and this ends up pushing your swap file to you remote git branch. This annoys you so you decide to add the *.swp files to your gitignore and push that change. Then you get a comment from your coworker who has been using NetBeans for his entire life asking "what is this line in the gitignore mean?" You don't really want to get into this conversation because it's only 2 hours into the workday and you were hoping to get something done before lunch.
So how can you avoid pushing swap files without adding cryptic patterns to your gitignore? Easy, just use the .gitignore. Not the local one, the global one. Here's how you activate your global gitignore.
$ git config --global core.excludesFile "$HOME/.gitignore"
All you need to do is add something like this to your global .gitignore:
# ~/.gitignore
*.swp
...and you will never have issues with pushing swap files again.