Following the proclamation of Indonesian independence, Yogi enrolled at the Yogya Military Academy in Jogjakarta. At that time, the academy was just recently established on 31 October 1945. Yogi, along with 441 other cadets, was accepted into the academy. During his military education in the academy, Yogi seized guns from the Japanese forces in 1945 and was put in charge at the Northern Bandung Front in 1946.