Home > OS >  How to get a list of all deleted unmerged branches in git/GITHUB?
How to get a list of all deleted unmerged branches in git/GITHUB?

Time:10-13

A long time ago i made some work in a branch, which I deleted during a clean up. So I would like to get it back because the request came up again. I can't remember the exact branch name. I have been looking at how to get git log display name of (deleted) branches, but I can't find it in the logs.

CodePudding user response:

I just write a node.js script find-deleted-unmerged-branches to find deleted unmerged branches (may with a name or without a name).

You can have a try with

npx find-deleted-unmerged-branches /path/to/your/git/repo

Will output something like:

┌─────────┬─────────────┬───────────┐
│ (index) │    name     │    sha    │
├─────────┼─────────────┼───────────┤
│    0    │ '<unknown>''bf2ef40' │
│    1    │ '<unknown>''dc1a360' │
└─────────┴─────────────┴───────────┘

Then checkout to given commit shas, and check whether it's the deleted branch.

  •  Tags:  
  • git
  • Related