Reputation: 93286
I have a Git repository that I want to remove all previous commits from.
Cause I tested to commit junk files, now I want to "start over" with the repository.
Is this possible?
Upvotes: 3
Views: 96
Reputation: 131730
Why not just delete the folder that contains the repository and create a new one?
If you want to save the latest versions of the files, you can just delete the directory .git
within the top-level directory of the repository.
If you want to save some other version of the files, check out that version first, then delete .git
.
Upvotes: 2
Reputation: 3123
Just delete the .git directory and 'git init' again to begin anew.
If you had done any configuration in the repo, you can always make a backup of the .git/config before removing the .git.
Upvotes: 4