def _get_default_branch(self) -> str:
        """
        Retrieves the primary Git branch name of the repository.

        Returns:
            str: The name of the primary branch.
        """
        cmd = 'git --no-pager remote show origin | grep "HEAD branch"'
        output = self.execute(cmd, self.cwd)
        return output.content.split()[-1].strip()

        Retrieves the primary Git branch name of the repository.

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