简体   繁体   English

如何打开 GIT bash 并使用批处理文件给出克隆命令

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM