iT邦幫忙

2

請問git clone 下載到指定現有資料夾 LINUX

  • 分享至 

  • xImage

請問 要下載指定現有資料夾如/tmp
git clone https://github.com/carlosmoshudev/ZTP-UbuntuZabbix.git tmp
git clone https://github.com/carlosmoshudev/ZTP-UbuntuZabbix.git /tmp
我用這兩種都會變成該路徑底下新增tmp 然後下載
請問正確語法

看更多先前的討論...收起先前的討論...
alien663 iT邦研究生 5 級 ‧ 2022-12-29 08:52:00 檢舉
1. 下指令 : git clone -?
2. 然後看指令解釋,找到關鍵字 : -filter
3. google找到解答 : https://help.aliyun.com/document_detail/309002.html
Kailis iT邦研究生 1 級 ‧ 2022-12-29 09:31:19 檢舉
cd 到該資料匣, 再把指令上的 tmp 改成你要的名稱就解決了...
ms2546088 iT邦新手 3 級 ‧ 2022-12-30 11:38:33 檢舉
非常感謝alien663
ms2546088 iT邦新手 3 級 ‧ 2022-12-30 11:38:50 檢舉
非常感謝Kailis
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

1
㊣浩瀚星空㊣
iT邦大神 1 級 ‧ 2022-12-30 08:37:42
最佳解答

你要先了解GIT是有根倉庫的概念。
一般會是依您目前的目錄為主。

而CLONE只能在根倉庫中去建立倉庫出來。
換言之,就是你所CLONE出來的東西,只魴在根倉庫下。不能指定到根倉庫外。

所以當你想要CLONE一個GIT下來時,如您想要放到實體路徑的根目錄下。
你只能先到根目錄才下CLONE指令。
不過有可能會有權限問題不給你CLONE就是了。

ms2546088 iT邦新手 3 級 ‧ 2022-12-30 11:40:19 檢舉

謝謝您㊣浩瀚星空㊣ 教導.以學習

0
小山丘
iT邦新手 2 級 ‧ 2022-12-29 08:54:38

你是要下載到你指定的資料夾?
先cd 到你要的資料夾
再輸入
git clone https://github.com/carlosmoshudev/ZTP-UbuntuZabbix.git
參考CD

ms2546088 iT邦新手 3 級 ‧ 2022-12-30 11:40:50 檢舉

非常感謝小山丘您的指路

我要發表回答

立即登入回答