Is there a way to browse Git commit history as a filesystem?

Viewed 130

My goal is to be able to read files from Git history using a typical text-editor, and even browse them using a typical file manager.

As far as I know, the only way to browse Git history is to check out different commits, making for a messy workflow if you want to, say, load two different versions of a file in your favorite IDE.

I'm looking to be able to browse Git history with a filestructure something like this:

.git_history
├──1f3499
│  ├──some_newer_code.c
│  ├──some_code.c
│  └──README.md
├──4efb9e
│  ├──some_code.c
│  └──README.md
└──6205a7
   └──README.md

So, is such a filesystem view of Git possible? As far as I understand, RepoFS and VFSforGit (formerly GVFS) do not do this, but I do not have any experience with these. I'd prefer to do this with "just git" if possible.

I apologize if this has been asked before. I am sure it must have, but I searched quite a bit and could not find it.

1 Answers

The tool gitk can display as "Tree" mode in lower right of window. It is not a filesystem but can give you an overview what repo file structure of at a certain commit looks like: gitk example

Git only records file changes of a commit, storing all files in repo for each commit may not be a good idea from disk-usage perspective. Thus using a tool may be a better way to achieve the goal.

Related