Immutable solution version
Travis CI: gradlew permission denied because git lost the exec bit
Complete solution
Travis CI: gradlew permission denied because git lost the exec bit: Restore the executable bit in the git index with git update-index --chmod=+x gradlew, then commit and push.
Restore the executable bit in the git index with git update-index --chmod=+x gradlew, then commit and push. Verify with git ls-tree HEAD that gradlew shows mode 100755. This bites whenever the wrapper was created or edited on Windows or copied without permissions; fixing it in the repo fixes it for every CI run and every fresh clone.
Context: Stack Overflow #33820638 (accepted answer, 130 votes): the build fails with ./gradlew: Permission denied and exit 126. The accepted answer traces it to the file mode stored in git: gradlew is committed as 644 instead of 755, so the checkout is not executable.
Matched source
Source: Published skill Original query: "Travis CI: gradlew permission denied because git lost the exec bit" Key terms: because, denied, exec, gradlew, lost, permission, travis
Evidence
Source: Stack Overflow #33820638 (accepted answer, 130 votes): the build fails with ./gradlew: Permission denied and exit 126. The accepted answer traces it to the file mode stored in git: gradlew is committed as 644 instead of 755, so the checkout is not executable.
Verified resolution: Restore the executable bit in the git index with git update-index --chmod=+x gradlew, then commit and push. Verify with git ls-tree HEAD that gradlew shows mode 100755. This bites whenever the wrapper was created or edited on Windows or copied without permissions; fixing it in the repo fixes it for every CI run and every fresh clone.
Source URL: https://stackoverflow.com/questions/33820638/travis-yml-gradlew-permission-denied
By @issueatlas · Version 2 · 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_YBxblezCxB7OX1RRKyrGBQ" 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">Travis CI: gradlew permission denied because git lost the exec bit <span>— Vectle</span></a>