@cli.command()<EOL>@pass_config<EOL>def rebase(config):
repo = config.repo<EOL>active_branch = repo.active_branch<EOL>if active_branch.name == "<STR_LIT>":<EOL><INDENT>error_out("<STR_LIT>")<EOL><DEDENT>active_branch_name = active_branch.name<EOL>if repo.is_dirty():<EOL><INDENT>error_out(<EOL>'<STR_LIT>'.format(<EOL>"<STR_LIT:U+002CU+0020>".join([repr(x.b_path) for x in repo.index.diff(None)])<EOL>)<EOL>)<EOL><DEDENT>state = read(config.configfile)<EOL>origin_name = state.get("<STR_LIT>", "<STR_LIT>")<EOL>upstream_remote = None<EOL>for remote in repo.remotes:<EOL><INDENT>if remote.name == origin_name:<EOL><INDENT>upstream_remote = remote<EOL>break<EOL><DEDENT><DEDENT>if not upstream_remote:<EOL><INDENT>error_out("<STR_LIT>".format(origin_name))<EOL><DEDENT>repo.heads.master.checkout()<EOL>repo.remotes[origin_name].pull("<STR_LIT>")<EOL>repo.heads[active_branch_name].checkout()<EOL>print(repo.git.rebase("<STR_LIT>"))<EOL>success_out("<STR_LIT>".format(origin_name))<EOL>info_out("<STR_LIT>")<EOL>
Rebase the current branch against origin/master