0

私は現在、クローズソーシングのために最近分割されたリポジトリで作業しています-モジュールは「メイン」リポジトリから離れた独自のリポジトリに移動されました。

panel/
    file.a
    file.b
    module1/ [untracked by panel repository, instead tracked in own repository now]
        templates/
            base.html
            ...
        views.py

ただし、module1リポジトリがまだ の一部であったこの分割の前にコミットされた作業がまだありますpanel。私の問題は、この分割の前後のコミットで作業しています。現在、両方のリポジトリが の一部であったときに作成されたコミットであるとのcherry-pick両方のファイルに変更を加えてコミットしようとしています。(ディレクトリ構造は変更されていません。リポジトリの のビューのみ)panelmodule1panelgit

メインリポジトリのディレクトリでチェリーピックすると:

nasonfish@nasonfish ~/P/P/p/panel2> git cherry-pick 8b7316d1ebff49e95a7971f88e669f50d9cbbf86
error: refusing to lose untracked file at 'panel/module1/views.py'
error: refusing to lose untracked file at 'panel/module1/templates/module1/view-hdr.html'
error: refusing to lose untracked file at 'panel/module1/templates/module1/view-base.html'
error: refusing to lose untracked file at 'panel/module1/templates/module1/base.html'
error: could not apply 8b7316d... mybranch: This is my commit
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

リポジトリ内のファイルを削除したり、メイン リポジトリに追加したりするつもりはないことがわかります。これは、分離を元に戻し、リポジトリを結合するだけだからですcherry-pick。 2 つをマージせずにベース リポジトリと子リポジトリを作成します。では、別のネストされたリポジトリ内のファイルがメイン リポジトリの一部であるように git を強制的に動作させ、リポジトリが分離される前からコミットをチェリー ピッキングできるようにする方法はありますか?

4

1 に答える 1