You must specify the variable in the script.
#!/bin/bash -e commit_message="$1" git add . -A git commit -m "$commit_message" git push
I also set -e so that if there are any errors, the script will exit without processing subsequent commands.
Regarding your second question,. The script should reference your current working directory as you plan. However, -A forces it to add all files that have been modified in the repo.
source share