-i, --interactive interactive picking -p, --patch select hunks interactively -e, --edit edit current diff and apply -f, --force allow adding otherwise ignored files -u, --update update tracked files --renormalize renormalize EOL of tracked files (implies -u) -N, --intent-to-add record only the fact that the path will be added later -A, --all add changes from all tracked and untracked files --ignore-removal ignore paths removed in the working tree (same as --no-all) --refresh don't add, only refresh the index --ignore-errors just skip files which cannot be added because of errors --ignore-missing check if - even missing - files are ignored in dry run --chmod <(+/-)x> override the executable bit of the listed files
On branch master Your branch is up to date with 'origin/master'.
Changes not staged for commit: modified: README.md modified: themes/sky (modified content)
Untracked files: gitpush.sh
no changes added to commit ' is not a git command. See 'git --help'.
The most similar command is push ' is not a git command. See 'git --help'.
The most similar command is
遇到这个问题我一开始的方向是以为 shell 命令没有写对,找了好一通的各种写法尝试
最后的解决:回到 ubuntu 下用 vim 编写,保存就不会有这些问题
3 尾声
解决掉这个问题后其他的就很顺利,从体验上来说,有了 shell 确实让人更舒服了
4 两个sh的实现
gitpush.sh git 的shell 提交
1 2 3 4 5 6 7 8 9 10
time=$(date "+%Y%m%d-%H%M%S") if [ -n "$time" ]; then git add -A git commit -m"${time}" git push git status echo "完成push" else echo "请添加注释再来一遍" fi