git-p4 import trees包含子目录.git

时间:2011-02-13 13:02:51

标签: git import perforce git-p4

我们公司使用Perfoce来管理项目,我使用git-p4来同步本地的Perforce存储库。 但是在P4存储库中,它与许多模块结合使用,并且可能包含某些模块的.git文件夹。有人在本地使用git并将.git /放到Perforce :(

当我通过git-p4克隆克隆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文件夹,然后再次克隆整个项目。

1 个答案:

答案 0 :(得分:0)

尝试在克隆时排除.git repos,即

git p4 clone ... -//module-by-git/.git