gitgit-baregit-show

How to view files in bare repositories?


I have a bare repository in my remote. I want to look at files, that is open in an editor and view the code. For listing files, git ls-files master or git ls-tree master. and for viewing single file, I could do git show 100644 But how do I view files in directories. Here is an example:

100644 blob 03ec70a7ab513de8d568450dd8fca93987a22da0    .gitignore
100644 blob 75a85b0137fe1ee0c60bda6dcfac78d2d59a1759    README.md
040000 tree 53a58d85bc833575fdfee86058d88a4928c6fe76    templates

If I do git show 03ec70, it shows the content of .gitignore file

If I do git show 53a58d, it lists the contents of template folder

403.html
404.html
500.html
base.html

But How can I open the individual files to see them. Example: base.html in the above case


Solution

  • git show ${branch}:templates/base.html