git是我們每天都會使用的工具,但是一般的使用還是直接通過幾個簡單的命令,例如:
git add .
git commit -m "..."
git push origin master
對于這種簡單的步驟踪央,我們每天都會重復(fù)無數(shù)次臀玄,所以巨懶如我就干脆搞個小腳本,直接點(diǎn)一下就提交了畅蹂。健无。
一、Window使用bat腳本一鍵提交代碼
直接新建文件液斜,保存成.bat格式累贤,編輯如下:
title GIT提交批處理——小二三不烏
color 16
echo 開始提交代碼到本地倉庫
echo 當(dāng)前目錄是:%cd%
echo 開始添加變更
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git add -A .
echo 執(zhí)行結(jié)束!
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo;
echo 提交變更到本地倉庫
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set /p declation=輸入修改:
git commit -m "%declation%"
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo;
echo 將變更情況提交到遠(yuǎn)程git服務(wù)器
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git push origin master
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo;
echo 批處理執(zhí)行完畢少漆!
echo;
pause
二臼膏、編寫Python腳本一鍵提交代碼
**額,用Python 好像就比較簡單示损,但是還得cmd輸一下渗磅,所以還是算了吧。检访。始鱼。 **