cloud,

How to clean Git commit history

Gineesh Gineesh Follow · 1 min read
How to clean Git commit history
Share this
# Create Orphan Branch
git checkout --orphan temp_branch

# Add Files to Branch and commit
git add -A
git commit -am "the first commit"

# Delete master Branch 
git branch -D master

# Rename temp/Current Branch to master
git branch -m master

# Push Changes to repo as master
git push -f origin master

Original post: How to Delete Commit History in Github

Gineesh
Written by Gineesh Follow
Backpacker, Foodie, Techie

Latest Stories

Featured