Remove Git Repository History

Please follow the below steps to completely remove the commit history

1. Clone the Git repository
2. Run rm -rf .git to remove all the .git files
3. Then run the below command to initialize the repo again and commit the changes


git init
git add .
git commit -m "Commit message"

4. Push the changes to Git


git remote add origin REPO_URL
git push -u --force origin master

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s