Egit - commited new project to wrong repository, can not delate it

天涯浪子 提交于 2020-01-03 04:18:08

问题


I recently created new project ("FirstSimpleWebDataBase") and committed it to new repo.
Today I was working on my old project ( "BeamReinforcement" ) and accidentally pushed whole "firstSimpleWebDataBese" project into it's repository.

When I check repo at Github it's shows this:

Added by accident project is grey and I would like to delete it.
I checked history in EGit but there is not such commit so I can not reverse it from eclipse. How can I fix it ?


回答1:


That gray folder is a gitlink (a special entry in the parent index)

What you can do locally is make sure that folder is removed:

  • make sure to move FirstSimpleWebDatabase outside the Git repo folder
  • type:

    git rm --cached FirstSimpleWebDatabase  # no trailing slash
    git add .
    git commit -m "record deletion of FirstSimpleWebDatabase gitlink"
    git push
    

Then you can go back to Egit and go on from there.



来源:https://stackoverflow.com/questions/40895623/egit-commited-new-project-to-wrong-repository-can-not-delate-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!