I want to clear the git log files so that the command git log
returns nothing. Is this possible? Is this recommended?
______________________________ . \ | / .
/ / \ \ \ / /
| | ========== - - WARNING!
\____________________________\_/ / / \ \
______________________________ \ | / | \ THIS WILL DESTROY
/ / \ \ \ / /. . YOUR REPOSITORY!
| | ========== - -
\____________________________\_/ / / \ \ /
______________________________ / |\ | / .
/ / \ \ \ / /
| | ========== - - -
\____________________________\_/ / / \ \
. / | \ .
git log
displays the change history of your project. If you really want to discard all of that history, you could...
rm -rf .git
git init
...but there are a relatively small number of situations where that really makes sense.
There aren't any "git log files" that git uses to produce this output; it is iterating over the database of objects that form the history of your project. If you delete the .git
directory like this, there's no going back: