The way to “reinit” repository

前端 未结 3 1174
無奈伤痛
無奈伤痛 2020-12-31 02:49

I\'ve made kind of a big refactoring in my project: I renamed files, removed, added... Besides, I added some folders in .gitignore. However, I\'ve already made a commit to a

3条回答
  •  梦毁少年i
    2020-12-31 02:58

    Here are steps to re-init repository.

    Scenario: I have deleted a locally project folder that I have made git init previously. After that, I would like to update to the existing git repository with a new folder of same project. Then I solved it by following procedure.

    Procedure

    git init
    git add --all
    git commit -am "re-init"
    git remote add origin https://github.com/{yourgit}/{yourproject}.git
    git push --force origin master
    

提交回复
热议问题