def METHOD_NAME(remote_name: str, remote_url: str, branch_name: str, token: str) -> RemoteProgress:
    from mage_ai.data_preparation.git import Git
    custom_progress = RemoteProgress()
    username = get_username(token)
    url = build_authenticated_remote_url(remote_url, username, token)
    git_manager = Git.get_manager()
    remote = git_manager.repo.remotes[remote_name]
    url_original = list(remote.urls)[0]
    remote.set_url(url)
    try:
        remote.METHOD_NAME(branch_name, custom_progress)
    except Exception as err:
        raise err
    finally:
        try:
            remote.set_url(url_original)
        except Exception as err:
            print('WARNING (mage_ai.data_preparation.git.api):')
            print(err)
    return custom_progress