@staticmethod
def init(repo_config):
    """Init remote url of the repo from the git server"""
    import logging
    from .process import ProcessWrapper
    import os
    import platform
    logger = logging.getLogger()
    logger.info('Initializing repository %s' % repo_config['path'])
    commands = []
    if platform.system().lower() == 'windows':
        commands.append('bash -c "cd \\"' + repo_config['path'] +
            '\\" && unset GIT_DIR"')
    else:
        commands.append('unset GIT_DIR')
    commands.append('git remote set-url ' + repo_config['remote'] + ' ' +
        repo_config['url'])
    commands.append('git fetch ' + repo_config['remote'])
    commands.append('git checkout -f -B ' + repo_config['branch'] + ' -t ' +
        repo_config['remote'] + '/' + repo_config['branch'])
    commands.append('git submodule update --init --recursive')
    for command in commands:
        res = ProcessWrapper().call(command, cwd=repo_config['path'], shell
            =True, supressStderr=True)
        if res != 0:
            logger.error("Command '%s' failed with exit code %s" % (command,
                res))
            break
    if res == 0 and os.path.isdir(repo_config['path']):
        logger.info('Repository %s successfully initialized' % repo_config[
            'path'])
    else:
        logger.error('Unable to init repository %s' % repo_config['path'])
    return int(res)
