search

Home  >  Q&A  >  body text

本地仓库 - git 如何删除本地创建的仓库

git 在本地创建了一个仓库并添加了文件,现在这个本地仓库不想要,怎么删除?而且不会删除仓库里面的文件?

漂亮男人漂亮男人2826 days ago690

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:24:04

    Solution

    You can clear the git files in the local folder first, and then re-initialize the new git repository

    //删除文件夹下的所有 .git 文件
        find . -name ".git" | xargs rm -Rf
    

    Then add, commit and other operations

    Extensions

    If the command line operation is really weak or cumbersome, you can use visual tools such as sourceTree to perform git operations, which should be simpler

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-02 09:24:04

    Directly clear the .git folder manually (non-violence and non-cooperation), and then init

    reply
    0
  • 阿神

    阿神2017-05-02 09:24:04

    I tried it, it works, thank you

    reply
    0
  • Cancelreply