Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An example that I just came across in normal usage:

   git show <branch_name>:<filename>
This will show you the contents of <filename> on <branch_name>. It does not show you the diff of that file for the latest commit to <branch_name>; it spits out the state of that file to the $PAGER. This is something that 'git diff' does not do. Note that <filename> doesn't even have to exist on the current branch, and you don't even have to have a working tree (i.e. you can do this in a bare repo to inspect file contents without actually needing to checkout a working copy of all of the code).


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: