远程:错误:对象:duplicateEntries:包含重复的文件条目 [英] remote: error: object: duplicateEntries: contains duplicate file entries

查看:42
本文介绍了远程:错误:对象:duplicateEntries:包含重复的文件条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们只是尝试将我们的项目从旧服务器移至gitlab.我选择使用方法

we just try to move our project from old server to gitlab.and I choose to use the method

git clone --bare git@xxx.git

git push --mirror gitlab git@xxx.git

但是,我的四个项目中有三个表现良好,仅剩下一个解决了这个问题.我尝试过

However,three of my four projects are behave ok,just the left one occour the problem. I have tried

 git ls-tree

 git replace

它不起作用.由于我几乎是git的新手,所以我不知道该怎么办,有人可以帮忙吗?3Q

it won't work. and as I am almost a new to git,I don't know what to do,anyone can help? 3Q

推荐答案

尝试树包含重复的文件条目"的方法之一.

一旦知道涉及哪个元素,就可以使用过滤器分支将其删除:请参阅"在推送时出现重复文件错误--镜像到Git存储库中"

Once you know which element is involved, you can use a filter-branch to remove it: see "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> )

(Replace <yourFile> by the problematic element)

这篇关于远程:错误:对象:duplicateEntries:包含重复的文件条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆