Clear all previous commits in Git?

I have a Git repository from which I want to delete all previous commits.

The reason I tested the command files, now I want to "start with" with the repository.

Is it possible?

+3
source share
2 answers

Delete the .git and git init 'directory again to start over.

If you made any configuration in the repo, you can always backup .git / config before deleting .git.

+4
source

Why not just delete the folder containing the repository and create a new one?

If you want to keep the latest versions of files, you can simply delete the directory .gitin the top level directory of the repository.

, , .git.

+2

Source: https://habr.com/ru/post/1760432/


All Articles