Does having german measles before, give you immunity to the real measles?

No. German Measles is caused by the Rubella Virus. This is a togavirus with single stranded RNA. Measles or Rubeolla is from the family called Paramyxoviridae (genus Morbillivirus) & is also single -stranded RNA. They are two entirely different viral infections and one does not confer immunity for the other.
Rubeola or rubella. Please do not confuse measles, also called rubeola, with german measles whose other name is rubella. Both illnesses are caused by different viruses. Infection with the measles virus does not confer immunity to german measles and vice versa.