Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.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
创建将为Git设置本地源目录和克隆repo的bat文件_Git_Batch File - Fatal编程技术网

创建将为Git设置本地源目录和克隆repo的bat文件

创建将为Git设置本地源目录和克隆repo的bat文件,git,batch-file,Git,Batch File,我对批处理文件脚本非常陌生,我设法克隆了我想要的repo(我想),但我不确定如何设置保存目录。我已经看过这篇文章了,但恐怕这并没有回答我的问题。以下是我到目前为止的情况: pullrepo.bat: start "" "C:\Program Files (x86)\Git\bin\git.exe" clone git@bitbucket.org:BLAHBLAHBLAH.git pause 当我查看显示所有内容的bat脚本(和git窗口)时,似乎一切正常,但我无法找到repo本地副本的文件夹(

我对批处理文件脚本非常陌生,我设法克隆了我想要的repo(我想),但我不确定如何设置保存目录。我已经看过这篇文章了,但恐怕这并没有回答我的问题。以下是我到目前为止的情况:

pullrepo.bat:

start "" "C:\Program Files (x86)\Git\bin\git.exe" clone git@bitbucket.org:BLAHBLAHBLAH.git
pause
当我查看显示所有内容的bat脚本(和git窗口)时,似乎一切正常,但我无法找到repo本地副本的文件夹(通过搜索文件夹名称),更不用说按照我的意愿设置本地保存位置了。最后,我的目标是添加一个推送功能,提示用户在其中一个窗口(git或bat)中输入提交消息。

除非在当前工作目录中明确指定,否则“保存目录”是以存储库名称命名的子目录(
BLAHBLAHBLAH
)(即在C:\Documents and settings\中,如果我没有记错MS Windows文件系统布局)。您还可以为
git clone
指定一个额外参数,该参数将是克隆的repo'目录的名称

另外,如果你不坚持使用CMD shell,我会切换到Bash。无论如何,Bash是随Git for Windows提供的,它有更好、更强大的脚本语言,符合我的口味。如果你真的喜欢基于控制台的交互式
Git
客户端,你也可以考虑:)