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

./
    whatever/
        .git

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

./
    .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 .

其他回答

进入文件夹。。如果文件夹为空,则:

git clone git@github.com:whatever .

else

git init
git remote add origin PATH/TO/REPO
git fetch
git checkout -t origin/master

克隆:

git clone git@jittre.unfuddle.com:jittre/name.git

克隆“特定分支”:

git clone -b [branch-name] git@jittre.unfuddle.com:jittre/name.git

由于某些原因,这种语法并不突出:

git clone repo url[文件夹]

这里,文件夹是指向本地文件夹(将是本地存储库)的可选路径。

Git克隆还会将代码从远程存储库拉入本地存储库。事实上,这是真的:

git clone repo-url  =  git init + git remote add origin repo-url + git pull

如果要克隆到当前文件夹,应尝试以下操作:

git clone https://github.com/example/example.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 .