Custom Search

Tuesday, May 26, 2015

How To GitHub delete a commit

Clone the repo to your machine.
#git clone

Find ID of the commit which comes just before the commit which you want to delete.
You can use the command "#git log -n 10" for that.

Then use this command:
#git rebase -i commit_id

Your text editor will open with a file that lists all the commits which come after your selected commit_id, and in front of each commit there is the word "pick".

In that list remove the commit which you want to delete and save it.

Force-push to remote repo.

#git push -f origin master

Check github. It should be updated

1 comment:

  1. Free easy & simple way to learn programming online we provide niit projects, assignments, cycle tests and much more..
    visit ====>>>