Move git code from server code to dedicated class