Gitlab: Permission Denied to Execute Script FIle

Anju
Jul 10, 2023

--

  1. Check the permission of script file
git ls-files --stage

100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 test.sh

2. If the permission bits are 644 then enable execute permission from cli

git update-index --chmod=+x test.sh
git ls-files --stage

100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 test.sh
#Commiy it
git commit -m "Adding Executable"
#Push the changes
git push origin test_branch

3. If shell file is not yet added to staging env

git add --chmod=+x test.sh
git commit -m "Adding Executable"
#Push the changes
git push origin test_branch

--

--

Anju
Anju

Written by Anju

A DevOps engineer who loves automating everything (almost), exploring new places, and finding peace in nature. Always looking for the next adventure!

No responses yet