In 1913, the Ottomans asked the Germans to assist in the development of a new military force, the Germans sent officer Liman von Sanders in reply. Sanders established the Ottoman I Corps in the city of Constantinople. Initially, the Germans viewed a relationship with the Ottomans as purely a means to secure the trade of military arms. The Ottoman Empire was also not initially interested in establishing an alliance with Germany, the empire originally attempted to form an alliance with Britain. Britain however ignored three Ottoman proposals for alliance in 1908, 1911, and 1913.
An alliance with the Ottoman Empire during WW1 offered two strategic advantages to Germany. An Ottoman army could provide the Germans with additional troops for overseas deployment and the Ottoman Empire’s territory would allow the German army access to land routes into Africa and Central Asia.  Eventually, the Ottoman Empire began to view the Germans as the safest choice for an alliance, Germany did not hold a major position in Asia Minor, and it lacked a large Muslim colony that might clash with the interests of the empire.  On July 22, 1914, the Ottoman Empire presented an offer of allegiance to the Germans. The Germans accepted the offer on August 2, 1914. At this point the Ottoman Empire did not enter into WW1.
Under the leadership of the Young Turks and the Committee of Union and Progress, and with the assistance of Liman von Sanders, the Ottoman Empire pushed to reform its military. Older officers were replaced in favor of younger officers. New equipment was brought in from Germany and a number of German military methods were adopted. The Ottoman Empire now required all of its citizens, both Muslim and non-Muslim to serve in the armed forces. The updates were well and good, but problems with the army did continue it lacked weapons, horses, and a common language. 
In the summer of 1914, the Ottoman Empire ordered two super-Dreadnoughts from the British. However, in August of 1914 Winston Churchill, the First Lord of the Admiralty decided against the delivery of the dreadnoughts to the Ottoman Empire. The British feared a strong Ottoman Navy would be able to counter the navies of the Greeks, Italians, and Russians. At this same time, there were two German warships sailing in the Mediterranean. British forces had attempted to intercept these two ships, but were unsuccessful. The Germans gifted the two warships, the Goeben and the Breslau to the Ottomans. Once the two ships arrived at Constantinople they were taken into the Ottoman Navy. The ships were renamed Sultan Selim Yavuz and Midilli, and their German crew members were outfitted in Ottoman navy uniforms. German officers remained in charge of the vessels. 
On October 29, 1914, the Ottoman Navy, including the two warships (under German command) attacked Russian sea ports in the Black Sea.  On November 2, 1914, the Russians declared war on the Ottoman Empire in retaliation and the British followed suit three days later.