命令git clonegit@github.com:whatever创建一个名为whatever的目录,其中包含Git存储库:

./
    whatever/
        .git

我希望将Git存储库的内容克隆到我的当前目录中。/而是:

./
    .git

当前回答

转到要克隆回购的目录。(不要在该目录中运行gitinit命令)只需运行命令,git clone<git repo url>。

示例:git clonehttps://github.com/Rashmi-Wijesekara/portfolio.git .

其他回答

如果要将其签入当前目录,请确保删除.git存储库。

rm-rf.git然后是git克隆https://github.com/symfony/symfony-sandbox.git

用法

git clone <repository>

将位于<repository>的存储库克隆到本地计算机上。原始存储库可以位于本地文件系统上,也可以位于可通过HTTP或SSH访问的远程计算机上。

git clone <repo> <directory>

将位于<repository>的存储库克隆到本地计算机上名为<directory>的文件夹中。

来源:设置存储库

要克隆到当前工作目录:

git clone https://github.com/link.git

要克隆到另一个目录:

git clone https://github.com/link.git ./Folder1/Folder2

希望它有帮助:)

转到要克隆回购的目录。(不要在该目录中运行gitinit命令)只需运行命令,git clone<git repo url>。

示例:git clonehttps://github.com/Rashmi-Wijesekara/portfolio.git .

For Windows user 

1> Open command prompt.
2> Change the directory to destination folder (Where you want to store your project in local machine.)
3> Now go to project setting online(From where you want to clone)
4> Click on clone, and copy the clone command.
5> Now enter the same on cmd .

It will start cloning saving on the selected folder you given .