diff --git a/PyGitUp/gitup.py b/PyGitUp/gitup.py index 674136c..dc81e14 100644 --- a/PyGitUp/gitup.py +++ b/PyGitUp/gitup.py @@ -205,7 +205,9 @@ def returning_to_current_branch(self): yield - print(colored('returning to {0}'.format(branch_name), 'magenta')) + if not self.repo.head.ref.name == branch_name: + print(colored('returning to {0}'.format(branch_name), 'magenta')) + self.git.checkout(branch_name) def config(self, key): """ Get a git-up-specific config value. """