How to reset "local" git repository?
GitGit Problem Overview
I was trying to ignore some folders when pushing and ended up with only the .gitignore
in the repository. Now want to "reset" my repository (by reset I mean to remove all the rules I applied and clean the commit area), so that I can add all my files and remove the folders I don't want after that. Any help?
Git Solutions
Solution 1 - Git
You could just delete your .git folder and start again.
rm -rf .git
git init
This will leave the current .gitignore in place, which would still be followed by the new git repo. The .gitignore could be removed, or delete the contents so it is a blank file.
Solution 2 - Git
If you want to create the repository again, then just remove the .git directory.
Solution 3 - Git
If you do not need a clean history just remove the files from the repository and commit your changes. If you would like to revert to an earlier commit there is a git reset command
git reset --hard HEAD^
Here is some more info https://stackoverflow.com/questions/927358/how-to-undo-the-last-git-commit?rq=1