The customary "formal" greeting in Standard German (Hochdeutsch) is Guten Tag, that's the one we learn in school and the one you would use in most parts of Germany. The Bavarian German is somewhat different. In fact, Bavarians themselves believe it to be a different language! Their formal greeting is "Gruß Gott", which literally means "Greet God".
This is peculiar. Why would you greet god when you greet someone? It seems a little blasphemous if you ask me. Does it mean you are greeting this person as an equal of god? Or that you are greeting god instead of the person you are talking to? I honestly don't get it, perhaps I am being an ignorant atheist. If anyone can explain it post a comment.
The first time I heard Gruß Gott was quite interesting. When you say it out loud it sounds like "gru - Scott". I was well confused, I looked very shocked and asked the girl "Wie wiessen Sie mein name?". Then it was her turn to be confused! Suddenly all my German had left me but luckily she spoke English so we had a good laugh at the misunderstanding.
Warum wurde man Gott grüßen?
Viel Spaß homies!