Our company uses Perfoce to manage projects, and I am using git-p4 to sync Perforce repository on my local side. But on P4 repository, it is combined with many module and may contain .git folder for some module. Someone uses git on local and put the .git/ to Perforce :(
When I clone the P4 by git-p4 clone, then it always say some files were removed.
# 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
I try to use "git filter-branch" to remove these files, but it forbid to use on a dirty working directory.
How can I do to fix this problem? In my previous workaround, I just remove these .git folders by Perforce tool, and then clone the entire project again.
Try to exclude the .git repos when cloning, i.e.