Sau một thời gian tôi muốn cập nhật repo git của tôi, và sau đó một cái gì đó đã đi sai. Cách thích hợp ra khỏi tình huống này là gì?Làm thế nào để cập nhật một repo git có chứa một submodule?
[email protected]:~/src/psi/ $ git status
iris: needs merge
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/common.cpp
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# unmerged: iris
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# gupdate.sh
[email protected]:~/src/psi/ $ git submodule status
+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)
+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)
+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)
[email protected]:~/src/psi/ $ cd iris
[email protected]:~/src/psi/iris/ $ cat .git/HEAD
cf237ef8f3d9dc058dbde47e6973e6388608ce60
Thú vị đủ, tôi đã thử nó và không thực sự giúp đỡ, nó vẫn nói rằng 'iris' là unmerged sau khi tôi đã cập nhật nó từ đầu. Và đáng ngạc nhiên nhất, vấn đề biến mất sau 'git add iris'. – mblsha
cách này hoạt động, nhưng tại sao lại là cách chính xác để xử lý việc này? –