On April 24, 1863, President Lincoln issued “General Orders No. 100: Instructions for the Government of the Armies of the United States in the Field.” Commonly referred to as the “Lieber Code” after its primary author Francis (Franz) Lieber, it dictated how soldiers should conduct themselves in wartime. The main sections concerned martial law, military jurisdiction, and the treatment of spies, deserters, and prisoners of war.
Also, John Fabian Witt, Lincoln's Code. For a discussion, (advance forward to 0:7 for the actual discussion) https://youtu.be/GwjQK5LZM_Q