簡體   English   中英

git clone進入主目錄

[英]git clone into home directory

$ 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

傳遞第二個參數時,clone命令會創建一個新目錄:

$ 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM