0

I'm trying to view git bare repository tracked file in CLI on my local machine, similarly how they display on GitHub (or any other git hosting provider).

Example:

"Minimal", equivalent of tree --dirsfirst:

.
├── src
│   ├── file-1
│   └── file-2
├── README.md
└── LICENSE

"Advanced", more like git hosting site, for example GitHub:

.
├── src        commit-message-1 1 hour ago
│   ├── file-1 commit-message-1 1 hour ago
│   └── file-2 commit-message-2 8 days ago
├── README.md  commit-message-3 year ago
└── LICENSE    commit-message-3 year ago

It would need to be colored to make it more readable but I hope I get my point across.

"Extra advanced" example would be example 2 ("Advanced") but interactive where you could navigate directories like with lf or yazi.

I know I could just use tree to achieve "minimal" example but I don't think I can use tree with git bare repository.

I know about git ls-files but that doesn't render file list in tree like view and I was hoping for more advanced view with commit messages, hashes and dates but even that would be something.

When searching for a solution, nearly all questions/answers I found were mentioning git ls-tree which is not what I want.

3
  • Why do you not want git ls-tree?
    – mkrieger1
    Commented Aug 1, 2024 at 21:09
  • @mkrieger1 because git ls-tree doesn't render a "tree" view like tree does, it just a flat list,
    – sloppy
    Commented Aug 1, 2024 at 21:24
  • If you just want to browse HEAD, the simplest way is probably to create a worktree and browse that.
    – Useless
    Commented Aug 1, 2024 at 21:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.