OSX: Set Mac hostname (i.e. avoid perforce workspace issues)
August 17th, 2010 by jeremychoneTo set the hostname of your Mac, do:
sudo scutil --set HostName myhostname.local
To check your hostname:
hostname
Source: Change the hostname in a Mac
This is particularly useful when using perforce from different location. Perforce link a hostname to a workspace, and OSX seems to take the hostname based on the network (in some occasions). So, you can end up with an error like:
Client ‘jeremy_MBPro_4′ can only be used from host ‘dyn105.sm1.corp.agkn.net’.