The saying in today's form has been recorded as early as 1840 ("shipshape" alone being about 200 years older).
Bristol was the most prosperous port of west-coast Britain, and its ship chandlery was of the highest quality.
The term may have developed in view of the port of Bristol which had (before the Floating Harbour was constructed) a very high tidal range of 13 metres (43 ft), the second highest in the world. Ships moored in this area would be aground at low tide and, because of their keels, would fall to one side. If everything was not stowed away tidily or tied down, the results were chaotic and cargo could be spoiled.