Shell脚本:github
Git 将本地文件 push 到 Resporsity
一般需要:add commit push 三个操作
本脚本实现:
1,对已经add的文件,一次commit
2,对未add的文件,一个一个add commit
已知不足:
1,对于新建文件夹,文件夹内文件不能一个一个add commit
只能一次性add commit一个文件夹
2,如果文件目录中包含空格,无法正确add commit push
3,默认是origin/master。可在代码最后一行修改。
操作:
直接将文件拷贝到Git文件夹的根目录
sh git_add_commit_push.sh
或
chmod +x git_add_commit_push.sh
./git_add_commit_push.sh
注意:
如果目录中有中文字符,运行
git config --global core.quotepath false