我们公司使用 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”来删除这些文件,但它禁止在肮脏的工作目录上使用。
我该如何解决这个问题?在我之前的解决方法中,我只是通过 Perforce 工具删除了这些 .git 文件夹,然后再次克隆整个项目。