I never understood why would Austria choose Hungary over Germany , I mean Austrians are Germanic people , Hungarian are not and also the culture is very similar, language too . What were the historical motives that made Austria choose Hungary over Germany
I recently answered a similar question here. Suffice it to say, the entity that would become the Austro-Hungarian Empire began with the Habsburg Archduke of Austria successfully pressing a claim on kingship of Hungary, followed by Austrian led conquest of Hungary from the Ottomans.
It's very important to note that for the majority of European history, Germany simply did not exist as a unified state that Austria could merge with. What we call "Austria" or the "Habsburg Monarchy" was originally only one of the more powerful states within the Holy Roman Empire. Habsburg power enabled them to nearly monopolise the position of Holy Roman Empire from 1440, with the election of Friedrich III as Emperor through to the dissolution of the Empire by Franz II in 1806, during the Napoleonic Wars. Austria was incredibly influential within the Holy Roman Empire, but--unlike in Hungary--the Habsburg Archdukes of Austria did not directly rule many of the territories within the Empire. The core of their territory, the Habsburg Hereditary Lands were concentrated around Austria, where they were Archduke of Austria, King of Bohemia, and King of Hungary, and so ruled these territories directly. When the Holy Roman Empire was dissolved, these were the territories that became the Austrian Empire that would ultimately endure until the final dissolution of the Habsburg monarchy in 1918. Even so, the question of unifying Austria with the rest of the German lands was a perennial one throughout the 19th century. Austria served as President of the German Confederation and remained highly influential throughout the German lands.
The question of German unification could be an entire answer in and of itself and it's not my main area of focus. Suffice it to say, that amongst German nationalists who desired a united Germany, there was a strong divide between proponents of Kleindeutschland and Großdeutschland. The former pressed for a unified Germany without Austria and its empire (and was more closely associated with Prussian leadership) while the latter would include Austria, but would likely still require the Hungarian and other Balkan holdings of Austria be excluded from the new empire. The Austrian were not willing to risk the loss of their holdings outside of the German Confederation. Ultimately, Germany would be unified under Prussian leadership with Austria completely excluded.
To summarise, it wasn't so much that Austria "chose" unification with Hungary over that with Germany. Rather, the Habsburgs directly rolled Austria and Hungary, while their power in Germany was always more indirect and distant. By the time that pressure for a unified German nation-state began to emerge, Austria preferred to hold on to its existing empire and Germany would ultimately form as Prussian-dominated Kleindeutschland.