当社は Perfoce を使用してプロジェクトを管理しており、git-p4 を使用してローカル側の Perforce リポジトリを同期しています。ただし、P4 リポジトリでは、多くのモジュールと結合され、一部のモジュールの .git フォルダーが含まれる場合があります。誰かがローカルで git を使用し、.git/ を Perforce に配置します:(
git-p4 clone で P4 を複製すると、常にいくつかのファイルが削除されたと表示されます。
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: module-by-git/.git/FETCH_HEAD
# deleted: module-by-git/.git/HEAD
# deleted: module-by-git/.git/ORIG_HEAD
# deleted: module-by-git/.git/config
# deleted: module-by-git/.git/description
# deleted: module-by-git/.git/hooks/commit-msg
# deleted: module-by-git/.git/hooks/pre-auto-gc
# deleted: module-by-git/.git/index
# deleted: module-by-git/.git/info/exclude
# deleted: module-by-git/.git/logs/HEAD
# deleted: module-by-git/.git/logs/refs/remotes/m/master
「git filter-branch」を使用してこれらのファイルを削除しようとしましたが、ダーティな作業ディレクトリでの使用は禁止されています。
この問題を解決するにはどうすればよいですか? 以前の回避策では、これらの .git フォルダーを Perforce ツールで削除してから、プロジェクト全体を再度複製しました。