Git File Mode Checker
Look up a Git mode or paste Git output to see what changed, including files that gained or lost the executable bit.
Build a Docker COPY --chmod instructionWhat the Git modes mean
- 100644
- Regular file, not executable
- 100755
- Regular file, executable
- 120000
- Symbolic link
- 160000
- Submodule commit
Git records file type and, for regular files, whether the file is executable. Use the permission mode comparison to check the individual read, write, and execute bits on disk.
Check what Git will commit
Run git diff --summary for unstaged changes and git diff --cached --summary for staged changes. Use git ls-files --stage to see the modes already recorded in the index. Stages 1, 2, and 3 identify unmerged entries.
To stage a script with its executable bit set, run git add --chmod=+x -- script.sh with your file’s path. This stages the file contents as well. Review git diff --cached before committing. To make the script executable on disk, use chmod +x script.sh.
Docker COPY --chmod Builder
Set permissions when copying a file or folder into a Linux image. Your paths stay in this tab.
One mode applies to every copied entry. Choose Mixed files and folders to keep ordinary files non-executable.
How Docker uses the source permissions
Without --chmod, a local build context preserves file permissions on disk. With a Git repository URL as the context, Docker uses 644 for regular files,755 for files marked executable in Git, and 755 for directories.
The mixed-folder preset u=rwX,go=rX gives copied directories and already executable files mode 755, and regular files without execute permission mode 644. A script missing the executable bit still needs a fixed mode like 755 or a fix at the source.