$ git clone ssh://host/repo.git ~/
destination directory '/home/username/' already exists.
谁能告诉我如何使这项工作?我正在尝试快速复制常见的开发脚本和配置。
$ git clone ssh://host/repo.git ~/
destination directory '/home/username/' already exists.
谁能告诉我如何使这项工作?我正在尝试快速复制常见的开发脚本和配置。
这似乎有效:
cd ~
git init
git remote add origin ssh://host/repo.git
git pull origin master
当您传递第二个参数时,克隆命令会创建一个新目录:
$ git clone ssh://host/repo.git ~/your_directory
clone
将创建~/your_directory
. 如果目录已经存在,它会给你你得到的错误。
cd ~
git clone ssh://host/repo.git
之后,您在/home/username/repo/
目录中就有了项目
如果您想将项目放在不同的文件夹名称中(例如 'foo/')
mkdir ~/foo
cd ~/foo
git clone ssh://host/repo.git foo/
我会将存储库克隆到一个子目录中:
git clone ssh://your/git/repo.git ~/repo
并创建指向配置文件的符号链接:
ln -s ~/repo/.bashrc ~/.bashrc