我的個人存儲庫有一些存儲庫作爲子模塊。而下面的命令遞歸地git拉所有的git子模塊只需
$ git submodule foreach git pull origin master
正進入紅寶石庫因爲Ruby庫似乎它不具有主分支和「混帳拉」停止後立即面臨以下結果。
Entering 'rails'
From git://github.com/rails/rails
* branch master -> FETCH_HEAD
Already up-to-date.
Entering 'roo'
From git://github.com/hmcgowan/roo
* branch master -> FETCH_HEAD
Already up-to-date.
Entering 'ruby'
fatal: Couldn't find remote ref master
Stopping at 'ruby'; script returned non-zero status.
所以我的問題是what should I do to git pull for all of submodules only by git command?
應該怎麼做讓一個腳本這樣做呢?我希望只有一個由git提供的命令行會做到這一點。
如果你不想'git的子模塊的foreach ...'停止時在子回購的一個出現錯誤只需添加'|| :'給命令,即'git submodule foreach'git pull origin master || :'' – 2013-02-20 08:13:13