【实用技能】通过sh脚本动态上传项目到github
生活随笔
收集整理的這篇文章主要介紹了
【实用技能】通过sh脚本动态上传项目到github
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
代碼一:
功能簡介
獲取commit -m 的信息,直接上傳遠程倉庫。
echo -n "Enter your commit message:" #參數(shù)-n的作用是不換行,echo默認(rèn)是換行 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# 不關(guān)閉當(dāng)前窗口 exec /bin/bash代碼二:
功能簡介:
自動獲取當(dāng)前日期,作為提交時候的信息,進行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# 不關(guān)閉當(dāng)前窗口 exec /bin/bash總結(jié)
以上是生活随笔為你收集整理的【实用技能】通过sh脚本动态上传项目到github的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue-cli2.9.6 build项目
- 下一篇: 【IDEA】自动导入无歧义的包