How to Change Your Computer Name on Mac OS X
When you’re sharing stuff back and forth between your computers, the names of those computers actually start to matter — in my case, I upgraded to a new MacBook Air because my old one has a dead screen and is out of warranty, so I made it into a desktop with an external monitor. That’s when I got an error that my two Macs had the same name. Oops! Luckily it’s an extremely easy fix.
Just open up System Preferences, go to Sharing, and change the computer name. Done!
You can also change it from the Terminal using this command, though obviously it’s much simpler to just change it under Sharing.
sudo scutil --set HostName [NewHostNameHere]