0

My goal is to get all the markdown files of a git Server and to display them as a kind of documentation platform for the project.

Is it possible to get a tree of all currently committed files of a git repository using command line?

Or is there any other possible option to get all markdown files including their path from a git repository?

(The main reason is a bonobo git server... if nothing else helps something platform specific is ok. But the goal is to make it work with every git)

(It would be even better if there is a JavaScript option to do that)

Tobias Kiehnlein
  • 184
  • 3
  • 12
  • A repository holds *commits* rather than files. Each commit holds files. Can you get a commit from a repository? Sure, *if* you have the repository. Otherwise, no. Find someone who has the repository and will give you the commit. For instance, GitHub will let you get any individual commit, as a tar or zip archive. From that *archive*, you can get any files you like. – torek Jan 26 '20 at 19:24
  • Yeah sure... but I don’t want to download the whole repository to get just the markdown files... isn’t there any other option? – Tobias Kiehnlein Jan 26 '20 at 19:28
  • There's nothing *standard*. Even downloading a tar or zip file is a GitHub-provided extension (easy to provide since `git archive` does it, but whoever does provide it has to hook that up). GitHub also provide their API for extracting portions of trees from GitHub-available commits. It may take multiple operations to get the entire tree from one commit. After that, it takes one operation per file to get each file. So you can implement this yourself through the GitHub API, but it's nontrivial, and then it only works with GitHub. – torek Jan 26 '20 at 19:33
  • I suspect Bitbucket and GitLab have similar APIs, but I imagine theirs is just different enough from GitHub's that each would require different code. – torek Jan 26 '20 at 19:34
  • OK... thank you very much.. I just hoped there is a way around downloading all the files... the git server is a bonobo Server which has no API at all... so I guess I have to download all the files and delete the files which aren't markdown – Tobias Kiehnlein Jan 26 '20 at 20:01

0 Answers0