compatibility if repository use gitlab as username
My organization host a gitlab instance and use gitlab as the gitlab@instanceUrl username. The original code only worked if the username is git. This pr improve this and made git and gitlab all compatible.