This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8215|Reply: 0

Git method to completely delete historical commit records

[Copy link]
Posted on 3/15/2018 5:22:21 PM | | | |
Sometimes we may encounter git commit errors, such as committing sensitive information or committing the wrong version. At this time, we want to delete the record submitted to the codebase, what do we do?


First, we need to find the hash of the commit point we need to roll back to, we can use the git log command to get the history of the commit to find the commit point we need to roll back to.


Copy the hash value, using git reset –hard commit_hash


Then use git push origin HEAD –force







Previous:This application requires a Java Runtime Environment 1.7.0
Next:MS SQL SERVER exports table structures to Excel
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com