I'm writing a bash script to add, commit, push all files in a directory.
#!/bin/bash
git add .
read -p "Commit description: " desc
git commit -m $desc
git push origin master
I'm getting the following error:
$ ./togithub
Commit description:
test commit script
error: pathspec 'commit' did not match any file(s) known to git.
error: pathspec 'script"' did not match any file(s) known to git.
Everything up-to-date
I'm not sure if this is a problem with reading in the text (it echo
s fine) or passing it to git commit -m
.
question from:
https://stackoverflow.com/questions/8482843/git-commit-bash-script 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…