Monday, 30 January 2017

github, remove commit logs

If you accidently pushed your password into github, and you delete it and repush. You may think this can remove your password from github, but actually, git have all your commit logs. to remove this. You should do this:


Solution:

Use:

git rebase -i <after this commit id>

Find out the commit id by running "git log"


Then after you ran git rebase, then you will get a "vi" opened

It will list all commits you want to delete, you need to change "pick" to "d", if too much to delete, you can delete lines, but at least you should keep one line otherwise the whole rebase will be ignored.

After that you need a force push.





No comments:

Post a comment