Commit History reset Git Repository

hello, this time I want to share how to Reset / Clear History Commit to the repository in git, in this case i use IDE CLion & Command Line Tools, immediately wrote ya.

Before Reset Commit History

This is a picture before the reset, then we open the IDE (Free) for this case i use IDE CLion for making the C ++ program, and then Menu dibagain down on the menu named “Terminal / Command Line”.

Commit reset via Command Line Tools

Here is the command that must be typed on the Command Line you (either terminal, CMD, Android Studio, CLion etc.)

Checkout 
git checkout --orphan latest_branch

Add All Files to git
git add -A

Doing Commit & give messages commit 
git commit -am "commit message"

Delete Branch (branch)
git branch -D master

Renaming branch (branch) Finally to branch Master 
git branch -m master

Tearkhir Mempaksa Push and Update your Repositories
git push -f origin master

After Reset Commit

if you’ve been successful, commit in git will terset from 3 to only one commit (on the case and this repository). and it’s a sign you successfully reset the commit history. if at the time of resetting the words “Everything up-to-date” please try again until the writing was not there, or repeat step from the beginning. Maybe it was just wanting i share, thank ya

Post Author: Study