Military law, on a practical basis, is prescribed by individual nations, but subject to differences with their national law for civilians, as well as overriding principles of international war. Generally respected military law is formulated within the context of just war theory.
Were a civilian official to order subordinates into situations known to be likely to cause them to be injured or killed, such an official would quite likely face an indictment for manslaughter. This does not mean that a civilian official cannot, for example, send firefighters or police officers into situations that are highly dangerous.
In the military context, however, generally accepted concepts of military necessity often mean that the first waves of troops attacking the enemy are certain to suffer extremely high casualties. Alternatively, a military commander may order selected troops to make a deceptive action which is intended to draw fire upon them, or to hold a rear guard position against an enemy not known to take prisoners.
There is no single reference for international military law, although there are a collection of agreements often grouped as "customary military law" or "laws of land warfare"
At the core of formal agreements are the Hague Conventions and Geneva Conventions. There are a wide range of relevant technical agreements, such as the Convention on Certain Conventional Weapons or the Convention on the Prohibition of the Use, Stockpiling, Production and Transfer of Anti-Personnel Mines and on Their Destruction. Individual national military law may not reflect agreements that the nation has not ratified, or treaties it has explicitly repudiated or refused to sign.
A given country typically will authorize its armed services to create regulations for all services and for specific branches of service, which have the force of law within the military. There may also be both overall codes for military trials and related functions, such as the U.S. Uniform Code of Military Justice, as well as for the Law of Land Warfare in military operations.
Certain doctrines have taken the form of law, as, for example, the legitimate techniques of interrogation allowed for U.S. military and civilian intelligence. These are prescribed in a U.S. Army Field Manual on Human Intelligence Collector Operations. 
- This is a term of art; it will be seen in discussions of war on sea or in the air. Additional law may be relevant to situations at sea.
- Manual for Courts-Martial (2008 Edition ed.), U.S. Department of Defense
- US Department of the Army (September 2006), FM 2-22.3 (FM 34-52) Human Intelligence Collector Operations. Retrieved on 2007-10-31