It is a belittling and derogatory word used to insult an
illegitimate child or to describe someone as worthless or foolish.
It's very disrespectful and not very nice.
View page
It is actually the other way round - Ron called Harry a git,
because he had snuck away early in the morning, while Hermione and
Ron were still asleep, and so they were worried because they didn't
know where he was.