Upvote:1
The general rule is that the command is with the most relevant officer.
E.g., an amphibious operation is commanded by the naval commander. I.e., when a ship lands an amphibious force on an enemy shore, the overall commanding officer is the ship's captain, not the amphibious force's commander. Moreover, even if the ship is lost and all troops are now ashore, the command remains with the ship's captain.
Similarly, a port will normally be commanded by a naval officer (unless it is under a land siege).
I know the answer is even broader than the question...