I want to execute 2 commands in one line:
git add filename
git commit -m "A message"
I'm trying this:
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "Usage: ./gac FILENAME COMMIT_MESSAGE" >&2
exit 1
fi
git add $1
git commit -m $2
But my problem is I have to write all the COMMIT_MESSAGE together, without spaces. How can I fix it?
I want ot use the script like this:
gac filename "my message with spaces and double quotes"