2017-06-21 51 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 –