Uninitialize git repository

后端 未结 4 794
孤街浪徒
孤街浪徒 2021-02-01 15:40

I have Initialized a git repository and have made some commit in that now for some reason I do not want to track any files in it and want to remove git from my local repo. Is th

相关标签:
4条回答
  • 2021-02-01 16:00

    Just deleting the .git directory stored in the repository will pretty much do it.

    0 讨论(0)
  • 2021-02-01 16:11

    git stores all the repository related data in a folder named ".git" inside your repository folder. So you just want to keep your files but change it into a "not-git-repository". Warning: this is irreversible!

    cd path/to/repo
    rm -rf .git
    

    The only files that might remain are hidden ".gitignore" files (but only if you added them yourself or using some tool like eclipse). To remove them:

    find . -name ".gitignore" | xargs rm
    
    0 讨论(0)
  • 2021-02-01 16:14

    go to the folder where you initialized git ,check on the hidden files we can see .git file deleting that file solves our problem

    0 讨论(0)
  • 2021-02-01 16:16

    Go to "File Explorer Options" in the control panel, there go to "View" and check the option that allows you to see the hidden folders.

    Then go to the folder where you want to un-initialize the git repository and you will find a folder called ".git" (it will be slightly faded since it's a hidden folder).

    Deleting this folder will do the trick.

    0 讨论(0)
提交回复
热议问题