Hello @Ony,
thank you for reaching out to the Wefugees community and for sharing your questions with us.
As you already hold a residence permit as a student, there is no urgent need to change your residence permit. You could finish your studies and consolidate your stay here provided you meet the conditions (good command of German, secured livelihood without social assistance, sufficient living space) relatively quickly after your studies.
If you marry your girlfriend, you can change your residence permit to a spouse visa, which would entitle you to consolidate your stay after three years and even apply for German citizenship, if the above mentioned conditions are met and you're still together then.
Acknowledgment of paternity makes sense anyway as long as you aren't married, if you wish that the child carries your surname. In this case, you also have to apply for joint custody.
On the basis of custody for a German child you could also apply for an other kind of residence permit according to § 28 Abs. 1 S. 1 Nr. 3 AufenthG, which will be extended as long as a "factual parent-child-relationship" exists, that is that you actively take care of the education and well-being of the child.
If you get married, you will automatically obtain joint custody and have to agree on a surname for the child. If you cannot agree on one name, the court will determine the surname.
I hope my answers were useful for you and I'll be very pleased if you contact me again with further questions. I'm a member of the mbeon-staff and I‘ll be glad to guide over a longer period of time. mbeon is an online advisory service for migrants via the mbeon-app, which you can download on your smartphone for free. You'll find me in the mbeon-app under my name „München, Frau Müller“ and get confidential one-to-one advice in a safe virtual room where nobody can read messages. For further information please visit ***.mbeon.de.
Download for Android: https://play.google.***/store/apps/details?id=de.zone35.mbeon
Download for iOS: https://apps.apple.***/de/app/mbeon-messengerberatung/id1408795643
Best regards,
mbeon-Christine