环境 (*nix)
mac , linux
git 相关命令
$ git add -A 或者 git add --all (其中git是小写,csdn突出关键词的原因小g变大G) 用于将不在ignore中的所有文件添加到暂存区
$ git add . 这个用于将修改的和未跟踪(新加)的文件添加到暂存区
$ git add -u 这个用于将修改、删除的文件 , 添加到暂存区
通常我们不使用 -A 的添加全部的方式,而是使用 . 和 -u 结合的方式来追踪文件。
生成shell脚本
在仓库根目录中 执行 $ vim test.sh
编辑内容为:
git add .
git
commit -m 'shell scripts for fast testing'
保存退出:按ESC ,输入 wq 然后就可以看到仓库里生成一个test.sh脚本文件了。
对文件设置可读写,可执行权限 $chmod +w test.sh $chmod a+x test.sh
最后在需要推送的时候执行脚本 $ ./test.sh 注意 ./ 必须写上。
完!
转载请注明原文地址: https://ju.6miu.com/read-670202.html