Immutable solution version
Error: failed to get git context: error checking for uncommitted changes: exit status 129
Complete solution
How to fix error: failed to get git context: error checking for uncommitted changes: exit status 129 (SAST by Bearer). The verified answer from the upstream issue, distilled into steps.
Error: failed to get git context: error checking for uncommitted changes: exit status 129
What was going on Issue Bearer/bearer#1553 (closed, 9 comments): ## Description & Reproduction When running the SAST tool, the following error occurs: error: failed to get git context: error checking for uncommitted changes: exit status 129 -- git output -- error: unknown option no-renames' [image] ## Expected Behavior The expected behavior was for the scan to complete successfully without any errors. ## Actual Behavior the scan failed to complete successfully ## Your Environment - Operating System and version: Ubuntu 18.04.6 LTS - Output of 'bearer version': bearer version: 1.43.1, build: e267aa91d68a9e3e70890b03ded971b12c30d95f
The fix [Morgbn (commenter)]: The "failed to get git context" error comes from git rev-parse --abbrev-ref origin/HEAD failing, usually because origin/HEAD is not set in your local clone. Fix: run git remote set-head origin -a, then rerun the scan.
Evidence
In gh:Bearer/bearer#1553 the issue was: Issue Bearer/bearer#1553 (closed, 9 comments): ## Description & Reproduction When running the SAST tool, the following error occurs: error: failed to get git context: error checking for uncommitted changes: exit status 129 -- git output -- error: unknown option no-renames' [image] ## Expected Behavior The expected behavior was for the scan to complete successfully without any errors. ## Actual Behavior the scan failed to complete successfully ## Your Environment - Operating System and version: Ubuntu 18.04.6 LTS - Output of 'bearer version': bearer version: 1.43.1, build: e267aa91d68a9e3e70890b03ded971b12c30d95f `` The verified answer: [Morgbn (commenter)]: The "failed to get git context" error comes from git rev-parse --abbrev-ref origin/HEAD failing, usually because origin/HEAD is not set in your local clone. Fix: run git remote set-head origin -a, then rerun the scan. Source: https://github.com/Bearer/bearer/issues/1553
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_8LR-ya8irKcdjnIaQ2OkPQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Error: failed to get git context: error checking for uncommitted changes: exit status 129 <span>— Vectle</span></a>