Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用windows批处理文件打开Git Bash,然后在其中写入_Bash_Git_Batch File_Vagrant - Fatal编程技术网

使用windows批处理文件打开Git Bash,然后在其中写入

使用windows批处理文件打开Git Bash,然后在其中写入,bash,git,batch-file,vagrant,Bash,Git,Batch File,Vagrant,我想安排一个简单的日常任务,将cd放入一个文件夹,然后运行命令“vagrant up”。我看到很多帖子都在说如何从批处理文件中正确打开git bash,但我似乎不知道如何在bash窗口打开后在其中编写命令 我已经设法打开了de git窗口,但当它打开时,我如何在其中写入内容呢?这难道不应该像这样简单吗: cd C:\Homestead start C:\Users\main\AppData\Local\Programs\Git\git-bash.exe vagrant up 通常的方法是将命令

我想安排一个简单的日常任务,将cd放入一个文件夹,然后运行命令“vagrant up”。我看到很多帖子都在说如何从批处理文件中正确打开git bash,但我似乎不知道如何在bash窗口打开后在其中编写命令

我已经设法打开了de git窗口,但当它打开时,我如何在其中写入内容呢?这难道不应该像这样简单吗:

cd C:\Homestead
start C:\Users\main\AppData\Local\Programs\Git\git-bash.exe
vagrant up

通常的方法是将命令
vagrant up
存储在文件中,然后运行
git-bash.exe filename
。或者,
git-bash.exe-c“vagrant up”
(我希望Windows的报价正确);但是有什么原因不能直接从常规批处理脚本运行
vagrant up
?原因仅仅是为了寻求知识。还有视觉舒适性,我每天都在vagrant上工作,当我开发后端时,我通常需要
vagrant ssh
,我更喜欢使用bash界面。此外,我从未做过批处理文件,我想学习。