{"record":{"id":"8aeb67bfb91be6aa","repo":"google-gemini/gemini-cli","slug":"failed-to-push-git-branch-e","errorCode":null,"errorMessage":"Failed to push git branch: {e}","messagePattern":"Failed to push git branch: (.+?)","errorType":"exception","errorClass":"OrchestrationError","httpStatus":null,"severity":"error","filePath":"tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py","lineNumber":665,"sourceCode":"        # Push branch securely using in-memory auth headers (force pushes are supported to override prior retries)\n        git_env = os.environ.copy()\n        if self.config.git_token:\n            auth_bytes = f\"x-access-token:{self.config.git_token}\".encode(\"utf-8\")\n            auth_b64 = base64.b64encode(auth_bytes).decode(\"utf-8\")\n            git_env[\"GIT_CONFIG_COUNT\"] = \"1\"\n            git_env[\"GIT_CONFIG_KEY_0\"] = \"http.extraHeader\"\n            git_env[\"GIT_CONFIG_VALUE_0\"] = f\"AUTHORIZATION: basic {auth_b64}\"\n\n        try:\n            CommandExecutor.run(\n                [\"git\", \"push\", \"-f\", \"origin\", f\"HEAD:refs/heads/{branch_name}\"],\n                cwd=self.config.pr_repo_path,\n                env=git_env,\n            )\n            logging.info(\"Branch push to remote succeeded.\")\n        except CommandExecutionError as e:\n            logging.error(\"Failed to push git branch: %s\", e)\n            raise OrchestrationError(f\"Failed to push git branch: {e}\") from e\n\n        # Submit Pull Request\n        if self.config.git_token:\n            repo_parts = self.config.repo_url.rstrip(\"/\").split(\"/\")\n            owner = repo_parts[-2]\n            repo_name = self.config.repo_name\n\n            pr_title = recommended_commit_msg if recommended_commit_msg else f\"[SSR Agent] Issue Fix: issues/{issue_num}\"\n            pr_body = recommended_pr_desc if recommended_pr_desc else (\n                f\"This Pull Request was automatically generated by the SSR Code Generator Agent \"\n                f\"to resolve issue `{issue_id}`.\\n\\n\"\n                f\"### Summary of Changes:\\n\"\n                f\"Applied targeted modifications to address the issue, validated with local compilation and unit tests.\"\n            )\n\n            client = GitHubClient(owner=owner, repo=repo_name, token=self.config.git_token)\n            try:\n                pr_number = client.create_pull_request(","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py#L647-L683","documentation":"Error \"Failed to push git branch: {e}\" thrown in google-gemini/gemini-cli.","triggerScenarios":"Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py:665 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}