how nice that you turned to wefugees with your question.
For people who have fled Ukraine, the EU's mass influx directive applies. It is intended to ensure immediate and collective protection and to relieve the asylum systems in the countries of the EU. It applies to Ukrainians, to family members, to people with Ukrainian protection status and to third-country nationals who had permanent residence in Ukraine at the time of the outbreak of the war. The last one applies to you.
Currently, until 31 August, you can move freely in the EU and in the Schengen area without a visa and also travel further. This means that you can travel to Germany with your girlfriend. Here you will register at a Landes-Erstaufnahme-Einrichtung (LEA) and apply for a residence permit according to § 24. In your case, however, it will be checked separately whether you can return to your country. Here it is important that you prove at the registration with your partner that you have had your centre of life and work in Ukraine for a very long time (e.g. by proving your studies, work as a specialist, life partner...). After registration and identification, you and your girlfriend will be assigned to a city and accommodated there. The foreigners authority then responsible will check whether you are granted residence under $ 24. If this is rejected, you have the opportunity to appeal against it.
You said that you applied for asylum in Poland. Did you withdraw it or was it rejected? The asylum application should not be a problem here, as you are not applying for asylum here in Germany.
If you have any further detailed questions, you can reach me in a private consultation room at mbeon (see my profile). I wish you and your friend all the best.