How to delete a specific revision of a github gist?

后端 未结 5 1968
时光取名叫无心
时光取名叫无心 2020-12-23 09:51

I created a Gist on GitHub and I saw informations I don\'t want anyone to see. I updated the file since, but everybody can still access the old revision of the file.

5条回答
  •  滥情空心
    2020-12-23 10:32

    If you are not concerned about showing any of the revisions on the gist, you can do the following to eliminate all history and just show one revision.

    git clone some-gist-repo
    cd some-gist-repo
    git rebase -i --root $tip
    

    You would be able to see all the commits for that gist in your editor. Just pick the first one and replace everything else with s or squash. Once done, save and add a commit message and then do a force push to master like this and you are good.

    git push -f origin master
    

    The only revision that would be visible is the addition of file(s) and thats it.

提交回复
热议问题