Git commit a permission bit
When the file permission bits of a script in git are missing the executable bit, you can't directly execute
this script after cloning the repository. Typically, the permission looks like -rw-rw-r--, but should be
-rwxrwxr-x.
To fix and commit such missing executable bits on a script in your git repo, follow the three steps below.
Step one: use the regular chmod command to set the permission bits right.
$ chmod +x the_script.sh
Step two: add the permission change to the index.
$ git update-index --chmod=+x the_script.sh
Step three: commit the change.
$ git commit -m "Add executable permission bits"
The file permissions are corrected, and the script can now be executed as expected.
-
Don't commit to main
Prevent accidental commits to a protected branch such as
main. -
Open GitHub when pushing a new branch
A trick to quickly create a pull request when pushing a new branch to remote by opening the repo in your browser.
-
Scanning with a samsung 4600 in ubuntu
How to let Ubuntu recognize a Samsung SCX-4600 as a scanning device.