diff --git a/src/gits b/src/gits index 2dbb011..10e94c0 100755 --- a/src/gits +++ b/src/gits @@ -337,12 +337,13 @@ def rebase(git_dir): git(git_dir, 'rebase', '-i', 'origin/master') # On conflicts, we'll exit with error implicitly - do_push = ask(git_dir, 'git push -f to overwrite %r?' % upstream_branch, - " don't overwrite upstream", - 'P `push -f` to overwrite upstream (P in caps!)', - valid_answers=('', 'P')) - if do_push == 'P': - git(git_dir, 'push', '-f') + if upstream_branch is not None: + do_push = ask(git_dir, 'git push -f to overwrite %r?' % upstream_branch, + " don't overwrite upstream", + 'P `push -f` to overwrite upstream (P in caps!)', + valid_answers=('', 'P')) + if do_push == 'P': + git(git_dir, 'push', '-f') return orig_branch