The Jewish canon (Old Testament) contains laws of war dating to ~2000 BC. The Code of Hammurabi (~1750 BC), the Mahabharata (400 BC), and Quaran (620 AD) all do as well. Most of these writings existed somewhere between sacred philosophy and practical governance.
The Greeks were less focused on humanitarianism and more on the protection of sacred sites/objects as typified in the Amphictyonic Council among the Greek states in 363 BC.
The Lieber Code, (General Orders No. 100, April 24, 1863) was the military law that governed the wartime conduct of the Union Army by defining and describing command responsibility for war crimes and crimes against humanity; and the military responsibilities of the Union soldier fighting in the American Civil War.
The first Geneva Convention was first held in 1864 and most notably revisited/revised in 1906, 1929, and 1949. Additional amendments in the form of protocol was added in 1977 and 2005.
Held in 1899 and 1907 the Hague Conventions were similar and part of the ongoing Geneva based conversation. Notably, these conventions were largely ignored in WW1 and claimed universal by the Nuremberg Trials.