Skip to content

Common Git Issues

โ† Back to Git


๐Ÿšซ File Permissions Issue

File permissions in Git Bash on Windows or Linux might differ from the remote repository (e.g., Gerrit or GitHub).

๐Ÿ” Check Permissions

Check the existing remote file permissions with the following command:

git ls-files --stage
Output typically looks like 100644 (rw-r--r--) or 100755 (rwxr-xr-x).

๐Ÿ› ๏ธ Fix Permissions

Update the permissions with the following command (e.g., to make a script executable):

git update-index --chmod=+x 'script.sh'

Check the file permission again to confirm consistency:

git ls-files --stage 

Commit the changes and push!


๐Ÿง  Quick Quiz โ€” Permissions

#

Which command is used to explicitly change file permissions in the Git index?


๐Ÿ“ Want More Practice?

๐Ÿ‘‰ Start Git Advanced Quiz (20 Questions)


๐Ÿ“ฌ DevopsPilot Weekly โ€” Learn DevOps, Cloud & Gen AI the simple way.
๐Ÿ‘‰ Subscribe here