批处理自动打开 gitbash、执行git命令(windows平台)

一、批处理文件直接执行git命令方法

Git装好后有个cmd目录,你把这个路径加到Windows的path环境变量下,然后像平时写bat批处理文件一样,

把git命令写到里边去就行了。不用搞bash的login操作。此时脚本中执行其他的dos命令和第三方命令行程序

均不受影响。
在这里插入图片描述二、实战

  1. 添加环境变量:D:\Git\Git\cmd

  2. 批处理脚本

@echo off
cd D:\apache-jmeter-4.0\bin\wms_performance   #wms_performance为本地git仓库目录
git add .   #直接执行git命令
git commit -m 'perfromanceTest'
git push -u origin master

猜你喜欢

转载自blog.csdn.net/baidu_24752135/article/details/107225928