Hi @kobs
I answered a question of yours on this relatively recently with some information on the Standesamt and getting assistance locally from the Johanniter organisation. You now write that you have exhausted your efforts. It would be easier for me to answer your question if I knew what these efforts were and why they were not successful.
As your partner is pregnant, that is an additional reason for you to be allowed to stay. Expectant fathers are entitled to get a visa to come to Germany already during the pregnancy. Strictly speaking, the authorities could tell you to first leave Germany and apply for a visa at the German embassy. Depending on the stage of pregnancy and the length of visa processing times in Ghana, you can then argue that this is unreasonable and you should be provided with a visa directly here. You would first have to do a declaration of paternity (Vaterschaftsanerkennung) and, if possible, declaration of shared custody (Sorgerechtserklärung) at the local Jugendamt.
In addition to your status as an expectant father, you have the additional options of applying for a residence permit as a partner of an EU citizen or, if you get married, as the spouse of an EU citizen.
Best,
Éanna