当前位置:   article > 正文

Windows 下bat脚本git提交代码到github

bat脚本git

Windows 下 git 提交脚本

每次向版本库提交代码的时候都要输入重复的命令,无形中也浪费时间。

git add . git commit -m “” git push …

不如直接来一个 push.bat 脚本省时省力。

请在第二行换成你的本地工作目录

@echo off
echo "DOCS PUSH BAT"

echo "1. Move to working directory" 
E:
cd E:\docs

echo "2. Start submitting code to the local repository"
git add *
 
echo "3. Commit the changes to the local repository"
set now=%date% %time%
echo "Time:" %now%
git commit -m "%now%"
 
echo "4. Push the changes to the remote git server"
git push
 
echo "Batch execution complete!"
pause
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

需要提交时直接双击运行即可。

或者设置为 Windows 定时任务,定时自动执行。

运行截图:
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/464254?site
推荐阅读
相关标签
  

闽ICP备14008679号