写个bat脚本一键提交代码到git上 - 图1

双击一下就能给当前目录直接提交到码云上.

写个bat脚本一键提交代码到git上 - 图2

  1. @echo off
  2. :: 获取当前脚本的路径
  3. cd /d %~dp0
  4. :: 自动提交
  5. git init
  6. git add .
  7. git commit -m "bat批处理自动推送:%date:~0,10%,%time:~0,8%"
  8. :: git commit -m "%commitMessage%"
  9. git push origin master
  10. @echo 已经完成,
  11. SET daoTime=60
  12. :dao
  13. set /a daoTime=daoTime-1
  14. ping -n 2 -w 500 127.1>nul
  15. cls
  16. echo 上传Git完成 ,倒计时退出: %daoTime%秒
  17. if %daoTime%==0 (exit) else (goto dao)

原文

https://zjj1994.blog.csdn.net/article/details/115518303