0

Is there a way to see all the branches that are archived? I used this answer to archive some of my branches. and there's a way to restore the branch after I have archived it, but only if I know the name. If I don't know the name, is there a way to see all branch names that have been archived?

some sort of

git branch -archive
Johanna
  • 566
  • 1
  • 4
  • 17

1 Answers1

2

Per the answer you linked, the "archive" operation is made by creating tags on each branch to be archived and then removing such a branches. So, after all you have no branches, you have only tags.

To list all tags with archive prefix in the name you can use

git tag -l "archive/*"

(note the archive part of command - it should match with a word you used when creating archive tags.

So, finally, to restore some archived branch from a tag (for example, named archive/test123) you can use

git checkout -b test123 archive/test123
Serg
  • 3,454
  • 2
  • 13
  • 17