git checkout --orphan temp_branch
git add -A
git commit -am "the first commit"
git branch -D master
git branch -m master
git push -f origin master
Source: tecadmin.net
git checkout --orphan temp_branch
git add -A
git commit -am "the first commit"
git branch -D master
git branch -m master
git push -f origin master
Source: tecadmin.net
#!/bin/bash | |
# Remove History Commit | |
# Create Orphan Branch | |
git checkout --orphan temp_branch | |
# Add Files to Branch | |
git add -A | |
git commit -am "the first commit" | |
# Delete master Branch | |
git branch -D master | |
# Rename Current Branch | |
git branch -m master | |
# Push Changes | |
git push -f origin master |