[英]How to open GIT bash and give clone commands using batch file
Start "" "%PROGRAMFILES%\Git\bin\sh.exe" --login
cd E:
git clone SshLink
The above command is first opening normal cmd
and then E:
drive and then gitbash
shell.上面的命令是先打开正常
cmd
然后E:
drive 然后gitbash
shell。 I just want to open git-shell
directly and change the directory to E:
drive and give clone
command.我只想直接打开
git-shell
并将目录更改为E:
驱动器并给出clone
命令。
You could try:你可以试试:
Start "" "%PROGRAMFILES%\Git\bin\bash.exe" -c "cd /e; git clone SshLink; bash"
That will open a bash, go to the drive E and try the git clone
这将打开一个 bash, go 到驱动器 E 并尝试
git clone
The final bash
allows for the session to not close immediately.最终的
bash
允许 session 不会立即关闭。
Other option, as mentioned in the comments by Compo :其他选项,如Compo 评论中所述:
Start /d E:\ "%ProgramFiles%\Git\bin\bash.exe" -c "git clone SshLink; bash"
That would use the /d
option of start
.那将使用
start
的/d
选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.