2017-08-17 55 views
-2

不混帳克隆我有很奇怪的行爲: 從tcsh的腳本,例如運行git克隆時:我可以從腳本

git clone /my repo/ . 

我得到的錯誤:致命的:「」目標路徑已經存在並且不是空目錄。

The directory doesn't contain ".git". 

如果我在終端之後運行相同的命令,那麼可以。

git版本1.9.3

我從python創建這個腳本。

我發現問題了。如果我在之前寫入「#」以在tcsh腳本中進行評論。爲什麼 ?

+1

是否有'/我的回購/'一個真正的空間?如果是這樣,您必須將repo網址放在引號中。 – Boldewyn

+0

請將您輸入的verbatim命令添加到* tcsh *和「terminal」(Bash?)到您的問題中。 – Melebius

回答

1

這是因爲.是一個相對路徑。 嘗試使用完整路徑,它應該工作。

git clone myRepo /tmp/myDir應該更好。

來源:https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone

Cloning to a specific folder

git clone <repo> <directory> 

Clone the repository located at  <repo>  into the folder called  ~<directory>!  on the local machine.

+0

什麼是託託?我嘗試使用完整路徑,但它不工作 – alex

+0

git clone my_repo/tmp /不起作用?你的腳本擁有exe權限? Chmod + x myScript – Totoc1001

+0

也嘗試使用sh不tcsh只是檢查:) – Totoc1001

相關問題