So let's say I have a hash ccf52ef35d7767c5b0f251542ab79608c50a3a56.
How do I use the git command line to get the contents of the file from the commit hash and file structure.
Also, how do I get a directory listing if the path is a directory, not a file. I do not need checking, just the two commands you would use for each.
I know this is the command:
git log [<options>] [<since>..<until>] [[--] <path>...] and here is the page.
I tried git log ccf52ef35d7767c5b0f251542ab79608c50a3a56, but that just returned the generic git log (all commits). I don't even know how I would get the contents of the file, except for maybe piping it into an ls or cat.
Edit: Okay so I figured out git show --pretty="format:" --name-only a3da8bb. Is the best way to just grep out either a directory and cat the file from there? Edit 2: Saw the answer, thanks. Still looking to figure out how to cat a file.