2012-07-25 116 views
2

我將此添加到我的應用程序:初始化子模塊使用Git

https://github.com/fpotter/juggernaut-cocoa 

在說明中,它說:

If you have git 1.7+ git clone git://github.com/fpotter/juggernaut-cocoa.git --recursive 

它不說在哪裏可以克隆它,所以我克隆它在我的文檔夾。然後我將AsyncSocket.h,AsyncSocket.m,WebSocket.h,WebSocket.m,SocketIoClient.h,SocketIoClient.m,JuggernautClient.h,JuggernautClient.m文件複製到我創建的文件夾中的項目中,這個文件夾位於供應商內部,名爲juggernaut-cocoa 。

但是,雖然文件在我的本地機器上工作,但當我推送到github時,他們永遠不會被添加。所有我看到的是一個小綠文件夾:

http://i47.tinypic.com/2ajnkzl.jpg

但是當我嘗試從另一臺計算機複製我的倉庫,該文件是不存在的,他們從來沒有加入到飯桶。

我又試圖克隆他們的項目到我的供應商文件夾,然後運行git的子模塊初始化,但得到這個:

No submodule mapping found in .gitmodules for path 'Vendor/juggernaut-cocoa' 

回答

0

注意AsyncSocket.mWebSocket.h,...是的github.com/erichocean/cocoa-websocket所有文件,這是:

所以,如果你在一個子子模塊修改任何東西,你就必須:

  • 推那些修飾的到erichocean/cocoa-websocket,也
  • 犯該回購ID早在fpotter/socketio-cocoa(的cocoa-websocket母公司回購),並推了出來,然後
  • 提交新fpotter/socketio-cocoa回購ID早在fpotter/juggernaut-cocoa(其母公司回購),並推送這個...

所以要確保這是你真正想要做/可以做的事情(因爲你需要有對這些回購的寫入權限,即被宣佈爲合作者)。

關於您的錯誤消息,請檢查No submodule mapping found in .gitmodule for a path that's not a submodule

+0

我不想修改任何東西。我只想將這些文件添加到我的存儲庫中 – JohnMerlino 2012-07-26 17:40:39

0

如果您手動從其他項目到你的複製文件,它們不會成爲你的回購協議的一部分,除非你加入他們:如果你想使用一個子模塊,而不是

git add vendor/juggernaut-cocoa/ 
git commit 

,增加它不是通過手動克隆完成,然後調用「git submodule init」。您只需撥打git submodule add即可。

首先,cd到您的主項目的根。然後

git submodule add https://github.com/fpotter/juggernaut-cocoa vendor/juggernaut-cocoa 
git commit