I am amazed that none of the above writeups have mentioned that electronic tuners exist for guitars. Given that these are dirt cheap (around fifteen pounds), allow for far greater accuracy than the human ear, and can be used even by people who do not have particularly good relative pitch (yes it is possible to play guitar without great pitch) that is the method used by every single musician I know.

Using a tuner also has the advantage of allowing one to tune up (or change into alternate tunings) between songs at a gig without any long drawn-out pauses - the only disadvantage being that the old joke about 'This is an old Chinese folk song - Tu Ning' is rapidly becoming obsolete.

Of course, it's always best to know how to do it 'by hand' for situations where you can't use a tuner for whatever reason, but it really does save a lot of time and effort...