Sol*_*ace 0 git bash github git-clone git-bash
我正在关注这个 MOOC来了解 Git。我在 Git Bash 中输入的第一个命令是,git --version它给了我git version 2.8.3.windows.1.
然后我输入git clone https://github.com/udacity/asteroids.git以克隆存储库。在视频讲座中,讲师输入命令时的屏幕如下所示:
但在我的 Git Bash 中,我得到以下输出。正如您在开始时所看到的,$ git clone出现了两次,但我只输入了一次命令。此外,我没有看到任何内容添加到我打开 Git Bash 的目录中。
我应该如何纠正这个问题?
$ git clone $ git clone
Too many arguments.
usage: git clone [<options>] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
--progress force progress reporting
-n, --no-checkout don't create a checkout
--bare create a bare repository
--mirror create a mirror repository (implies bare)
-l, --local to clone from a local repository
--no-hardlinks don't use local hardlinks, always copy
-s, --shared setup as shared repository
--recursive initialize submodules in the clone
--recurse-submodules initialize submodules in the clone
--template <template-directory>
directory from which templates will be used
--reference <repo> reference repository
--dissociate use --reference only while cloning
-o, --origin <name> use <name> instead of 'origin' to track upstream
-b, --branch <branch>
checkout <branch> instead of the remote's HEAD
-u, --upload-pack <path>
path to git-upload-pack on the remote
--depth <depth> create a shallow clone of that depth
--single-branch clone only one branch, HEAD or --branch
--separate-git-dir <gitdir>
separate git dir from working tree
-c, --config <key=value>
set config inside the new repository
-4, --ipv4 use IPv4 addresses only
-6, --ipv6 use IPv6 addresses only
Run Code Online (Sandbox Code Playgroud)
在我看来,您获得的输出显示了您可以从中选择要提供给命令的参数的选项。尝试使用这些参数之一,例如git clone https://github.com/udacity/asteroids.git --bare.
我刚刚尝试过git clone https://github.com/udacity/asteroids.git --bare,它对我有用。它克隆了存储库,并且 Bash 中的输出与您所期望的非常相似:
$ git clone https://github.com/udacity/asteroids.git --bare
Cloning into bare repository 'asteroids.git'...
remote: Counting objects: 209, done.
remote: Total 209 (delta 0), reused 0 (delta 0), pack-reused 209
Receiving objects: 100% (209/209), 184.61 KiB | 99.00 KiB/s, done.
Resolving deltas: 100% (128/128), done.
Checking connectivity... done.
Run Code Online (Sandbox Code Playgroud)
编辑:
抱歉之前我没有尝试这个简单的命令git clone https://github.com/udacity/asteroids.git。我尝试过,它也对我有用。
$ git clone https://github.com/udacity/asteroids.git
Cloning into 'asteroids'...
remote: Counting objects: 209, done.
remote: Total 209 (delta 0), reused 0 (delta 0), pack-reused 209
Receiving objects: 100% (209/209), 184.61 KiB | 154.00 KiB/s, done.
Resolving deltas: 100% (128/128), done.
Checking connectivity... done.
Run Code Online (Sandbox Code Playgroud)
请小心并重试。
| 归档时间: |
|
| 查看次数: |
6103 次 |
| 最近记录: |