Does github keep deleted remote branches in history? If so, can those be restored?

后端 未结 5 1137
暗喜
暗喜 2020-12-02 14:15

I was wondering if there is a way to restore a remote deleted branch in github. History clearly keeps record of the branch and merges with other branches but I\'m not sure i

5条回答
  •  隐瞒了意图╮
    2020-12-02 14:39

    Take a look at this python script for github events. https://github.com/jimzucker/githubutils/blob/master/githubreflog.py

    I created it to pull events and make them readable, you can pipe it in to grep and look for the branch you are interested in. if there is enough history you will see the delete event for the branch in question, the next line will be the last push event and that is the sha you are interested in.

提交回复
热议问题