According to Article II, Section 2, Clause I of the Constitution, the President of the United States is ''Commander in Chief of the Army and Navy of the United States, and of the Militia of the several States, when called into the actual Service of the United States.'' Since the National Security Act of 1947, this has been understood to mean all United States Armed Forces. U.S. ranks have their roots in British military traditions, with the President possessing ultimate authority, but no rank, maintaining a civilian status, other than the title of Commander in Chief. The exact degree of authority that the Constitution grants to the President as Commander in Chief has been the subject of much debate throughout history, with Congress at various times granting the President wide authority and at others attempting to restrict that authority.

Is it true that is the president the head of the military?
yes