Created
April 15, 2018 23:35
-
-
Save muhfaris/15c6e3ff9f5987df1b99a99797d1e567 to your computer and use it in GitHub Desktop.
remove history commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check out to a temporary branch: | |
git checkout --orphan TEMP_BRANCH | |
# Add all the files: | |
git add -A | |
# Commit the changes: | |
git commit -am "Initial commit" | |
# Delete the old branch: | |
git branch -D master | |
# Rename the temporary branch to master: | |
git branch -m master | |
# Finally, force update to our repository: | |
git push -f origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment