2017-12-21 15 views
1

私の質問は次のようなものです: How do I update a GitHub forked repository? 私のアップストリームはサブモジュールがたくさんある非常に大きなプロジェクトなので、ちょっと複雑です。GitHub分岐リポジトリをサブモジュールで更新するには

git remote -v 
navi_dev  ssh://[email protected]/navi_development (fetch) 
navi_dev  ssh://[email protected]/navi_development (push) 
origin [email protected]:navi_int_internal.git (fetch) 
origin [email protected]:navi_int_internal.git (push) 

nave_devは取得したいルートの上流にあり、originはローカルフォークです。

が、このプロジェクトでは、サブモジュールがたくさんある: など:

[submodule "ai_osal_common"] 
     path = ai_osal_common 
     url = gitolite:ai_osal_common 
[submodule "ai_osal_darwin"] 
     path = ai_osal_darwin 
     url = gitolite:ai_osal_darwin 

... 

私の質問は、私はまた私の地元のレポにこれらのサブモジュールをフォークしたい、です。 サブモジュールを更新し、ルートアップストリームも更新できます(ルートアップストリームはサブモジュールハッシュを更新する可能性があります)。 ルートアップストリームとそのサブモジュールの両方をローカルリポジトリに同期させるにはどうすればよいですか?

答えて

1

提案したリンクと同じように各サブモジュールで同じことを行いますが、各サブモジュールがそれぞれのマスターブランチから最新のものになり、正しくない可能性があります。

だから私の提案は以下の通りです:あなたは任意のサブモジュールの変更を自分で作っている場合は

# Fetch all the branches of navi_dev remote into remote-tracking branches: 

git fetch navi_dev --recurse-submodules 

# Make sure that you're on your master branch: 

git checkout master --recurse-submodules 

# Rewrite your master branch so that any commits of yours that 
# aren't already in navi_dev/master are replayed on top of that 
# other branch: 

git rebase navi_dev/master 

を、あなたは、元のリモート・マスター・ブランチの上にも、それらをリベースしなければなりません。

関連する問題