Military law is a distinct field and through out history there was always a military code or law that regulated men who bore arms or were termed warriors. Such laws existed right from the Roman era and ancient India. The United States like most countries also enacted legislation to regulate military discipline. It must be remembered the USA was initially a colony of the British till 1776 when a war of Independence between the settlers and the British resulted in their ouster.
Military law in the United States can thus be traced to the British rule. They were the first to enact the Articles of war in 1774 to regulate their army. This is the first recorded code on the American continent. Temperatures were however getting hot between the settlers and the British and the settlers and they realized that war was imminent. They also felt they would need a set of laws to control their own army. This led to the Articles of war 1775, which were adopted by the settlers.
The articles of adopted by the settlers were a copy of the British articles of war and were a set of rules to regulate the armed men. The 1775 articles of war had 69 sections and were drafted by John Adams who was an attorney at that time. The articles of war 1775 were adopted by the Second International Congress for the Continental Army.
The declaration of independence in 1776 led to these Articles of war being accepted as the first codified military law for the US army. However in 1806 the scope of the Articles of war was greatly expanded and the number of sections rose from 69 to 101. For the next 160 years these Articles of war were not amended, even though a new element in the form of Air power and the Air Force appeared on the scene.
But there were serious deficiency in these articles of war. These came to the fore when during the First World War 13 Negro soldiers were hanged for rioting at Houston. This had a salutary effect and the then secretary of War Newton D Barker banned further executions without approval from the capital Washington. This was a major change as far as confirmations of sentences were concerned.
The end of the Second World War led the US Government and the US chiefs of staff to think in terms of a single code for all the soldiers and arms from the Navy to the army and Air Force. An expert committee examined the pros and cons of a new law. They concluded that the law needed revision and recommended a unified Military code applicable to all men bearing arms. In 1951 as a follow up, the Unified military code of Justice was signed into law by President Truman. The new code is more humane and does have a set of checks and balances and confirmation of sentences.