【实用技能】通过sh脚本动态上传项目到github
代码一:
功能简介
获取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
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
