我有一個父回購A和子模塊回購B,它在主人的最新提交時簽出。我已經在repo A中運行了git submodule update --init --recursive
,所以我的子模塊已經在它裏面了。我知道我可以在該命令上拋出一個--remote
標誌,讓它從最新的提交中更新,但我無法弄清楚的是如何更改子模塊提交#,以便每當其他人運行git submodule update --init --recursive
時,它將從子模塊中的最新提交中更新。有任何想法嗎?謝謝。如何配置父回購從子模塊的頭更新?
1
A
回答
0
git submodule update --init --recursive
,它也將從子模塊中的最新提交更新。
否,該命令僅檢查出在被記錄gitlink(special entry in the parent repo)子模塊。
你需要(內拉的git子模塊日)添加--remote
迫使分支更新
但是要記住,任何子模塊將被更新,如果沒有在.gitmodules
發現拖欠其上游主分支。
請參閱「Git: track branch in submodule but commit in other submodule (possibly nested)」。
0
解決方式:
1)CD插入子模塊 2)自上次更新子模塊有我的一個承諾,這不是最新的,我剛剛簽出最新的提交(git checkout [commit_hash]
) 3)CD在那裏,回到父回購 4)git add submodule - > commit - > push
相關問題
- 1. 從父模塊向子模塊添加配置文件的Spring模塊war
- 2. 如何更新子模塊
- 3. 如何更新子模塊?
- 4. Git:推動回購錯誤。 (錯誤更新子模塊)
- 5. 如何從根回購檢查git子模塊狀態?
- 6. 如何用zuul,Gearman和Jenkins處理git子模塊的父回購?
- 7. Git的子模塊的commit主回購
- 8. 子模塊不繼承從父pom配置文件
- 9. 單個子模塊的多次回購
- 10. 如何更新Github回購
- 11. 設置與其他Git回購與子模塊的Git回購? (WordPress開發)
- 12. 如何將工廠從父模塊共享到子模塊?
- 13. 我們如何從父模塊中提取所有子模塊?
- 14. Git子模塊與回購裏面的回購
- 15. 如何從子範圍內更新父範圍中的模型?
- 16. 如何在我的回購中使用克隆的子模塊?
- 17. 你如何通過從源頭拉動更新所有git子模塊?
- 18. 如何更新git子模塊?
- 19. 如何正確更新git子模塊?
- 20. 將git回購轉換爲子模塊
- 21. 可以回購遞歸子模塊嗎?
- 22. 子模塊或.gitignore插件回購?
- 23. git子模塊與其他回購
- 24. 推動子模塊回購Github
- 25. 子模塊裸回購問題
- 26. Git:創建回購作爲子模塊
- 27. Fork Github回購與子模塊?
- 28. 從子目錄創建Git回購在父回購
- 29. 當多個git帳戶配置時更新子模塊
- 30. 如何爲特定模塊配置模塊回退路徑?
你不需要:如果你的子模塊設置爲跟蹤一個分支(就是說如果它有一個' submodule。。''.gitmodules')'--remote'就足夠了。 –
VonC