开发者

Reading Git commands using Batch(.BAT) file

I have written DOS commands and GIT commands in notepad and converin开发者_StackOverflow社区g to .BAT file.After executing the Batch file only DOS command will be executed GIT commands not executing.How do i run GIT commands using Batch(.BAT) file


Make sure that git is in your PATH system environment variable and if it is then you should be able to call git just like you normally would in the terminal. Please note that you will need to restart the terminal (cmd) for path changes to take effect.


The git command in Msysgit is implemented by using a batch file to wrap all the calls and run the correct executable with the correct environment variables. You can not execute a batch file from another batch file normally like you would an executable, you have to use a special command to run them. If my memory is correct that command is call and would be used as call git push for example.


Hai All, Finally I got the solution for my question.By using below code snippet, we can run the Git using BAT file

"c:\Program Files\Git\cmd\git.cmd" pull > c:\platform.txt

the above code using from BAT file instead of using git pull or git push and any git command using GIT Bash

Thanks to all for posting your valuable comments and partial answer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜