tags:

views:

29

answers:

2

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?

+3  A: 

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.

signine
+1, this is the whole *point* of git. See Linus' talk on why he created it.
Ninefingers
+2  A: 

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.

David Zaslavsky