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?
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?
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.
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
.