【实用技能】通过sh脚本动态上传项目到github -凯发k8官方网
凯发k8官方网
收集整理的这篇文章主要介绍了
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
代码一:
功能简介
获取commit -m 的信息,直接上传远程仓库。
echo -n "enter your commit message:" #参数-n的作用是不换行,echo默认是换行 read msg #从键盘获取信息输入 echo "commit success!,your commit msg is $msg , welcome to my program" git add .git commit -m "$msg"# 上传到 gitee git push origin master # 上传到 github git push origin_github master# 不关闭当前窗口 exec /bin/bash代码二:
功能简介:
自动获取当前日期,作为提交时候的信息,进行commit。
time=$(date " %y-%m-%d") echo "commit success!,your commit msg is $time , welcome to my program"git add .git commit -m "$time"# 上传到 github git push -u origin main# 不关闭当前窗口 exec /bin/bash总结
以上是凯发k8官方网为你收集整理的的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇:
- 下一篇: