def _get_current_branch(self) -> str:
        """
        Retrieves the currently selected Git branch.

        Returns:
            str: The name of the current branch.
        """
        cmd = 'git --no-pager rev-parse --abbrev-ref HEAD'
        output = self.execute(cmd, self.cwd)
        return output.content.strip()

        Retrieves the currently selected Git branch.

        Returns:
            str: The name of the current branch.
        
openhands/runtime/utils/git_handler.py