Add private repo support for git

Adds support for working with private git repositories.

A git clone tries to fetch the given repository URL. If the server responds with `Authentification required` error, a git login dialog is shown. 

@dinhviethoa 
This code is duplicated at 3 places. I added a todo at one place. Will add the helper function sooner than later.