2017-06-21 105 views
1

我们只是尝试我们的项目从旧服务器移动到gitlab.and我选择使用方法远程:错误:对象:duplicateEntries:包含重复的文件项

git clone --bare [email protected] 

git push --mirror gitlab [email protected] 

但是,我三四个项目的是表现良好,只是左边的一个问题。 我试图

git ls-tree 

git replace 

将无法​​正常工作。因为我几乎是一个新手,我不知道该怎么做,任何人都可以帮忙? 3Q

回答

0

尝试one of the methods of "Tree contains duplicate file entries"

一旦你知道哪些因素参与其中,您可以使用过滤器,分支将其删除:详见“duplicate file error while pushing --mirror into Git repository

git filter-branch -f --index-filter \ 
    'git rm -rf --cached --ignore-unmatch <yourFile> && \ 
    git ls-files -s | git update-index --index-info' \ 
--prune-empty --tag-name-filter cat -- --all" 

(由有问题的元件替换<yourFile>

+0

不,不要”为我工作,谢谢你,还有其他想法? –

+0

是的,试着看看git bundle:它会将你的git repo压缩到一个文件中,你可以将它复制到你的服务器上,然后从该文件中克隆--bare,用这个文件替换你的gitlab裸回购。 – VonC

+0

是的,它的工作,3Q非常多,我忘了更换SampleApp –