git checkout --orphan temp_branchgit add -A
git commit -am "the first commit"git branch -D mastergit branch -m mastergit push -f origin masterSource: tecadmin.net
git checkout --orphan temp_branchgit add -A
git commit -am "the first commit"git branch -D mastergit branch -m mastergit push -f origin masterSource: 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 |