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
如何将git克隆和CD放入我刚刚在一行中创建的文件夹中?_Git - Fatal编程技术网

如何将git克隆和CD放入我刚刚在一行中创建的文件夹中?

如何将git克隆和CD放入我刚刚在一行中创建的文件夹中?,git,Git,在我的课程中,我们经常使用git克隆,然后将其刻录到我们刚刚制作的文件夹中。 我们有数百个存储库,因此可以节省/继续节省大量时间。特别是当我们克隆的东西有相似的名字时 我曾尝试用谷歌搜索这个问题,并尝试在git克隆的“repo here”行中添加一些内容 例如,我在一个名为week 4的文件夹中,我现在做的是复制一个repo,比如说“advanced JS”,然后是gcl advanced JS,然后是cd advanced JS。 但是我想做什么呢?键入gcl advanced JS(x),让

在我的课程中,我们经常使用git克隆,然后将其刻录到我们刚刚制作的文件夹中。 我们有数百个存储库,因此可以节省/继续节省大量时间。特别是当我们克隆的东西有相似的名字时

我曾尝试用谷歌搜索这个问题,并尝试在git克隆的“repo here”行中添加一些内容

例如,我在一个名为week 4的文件夹中,我现在做的是复制一个repo,比如说“advanced JS”,然后是gcl advanced JS,然后是cd advanced JS。 但是我想做什么呢?键入gcl advanced JS(x),让它把它克隆到我的电脑上,然后把cd放进它刚刚制作的文件夹中。x是这里的未知


谢谢。

正如这里(和类似地方)所述:

您可以创建一个shell函数:

gclonecd() {
   git clone "$1" && cd "$(basename "$1" .git)"
}

如上所述(以及类似的地方):

您可以创建一个shell函数:

gclonecd() {
   git clone "$1" && cd "$(basename "$1" .git)"
}

在您选择的shell of ChoiceId中编写一个shell脚本您尝试了
git clone repo url和cd repo文件夹
?在您选择的shell of ChoiceId中编写一个shell脚本您尝试了
git clone repo url和cd repo文件夹