def _commit_and_push(git_repo, branch_name, commit_message, verbose):
    """Commit and push to the remote branch."""
    git_repo.index.commit(commit_message)
    if verbose:
        print('Add commit: {0}'.format(commit_message))
    remote = git_repo.remote(name='origin')
    refspec = 'refs/heads/{br}:refs/heads/{br}'.format(br=branch_name)
    remote.push(refspec=refspec, force=True)
