Better Git: Interact With a Branch, Without Checking it Out.
Tricks for interacting with a branch, without checking it out.
Browse a directory (like ls): Syntax: git show [ref]:[path]
| |
See contents of a file (command as above): Syntax: git show [ref]:[filepath]
| |
Checkout a specific file or directory from a different branch: Syntax: git checkout [ref] – [path]
| |
Note: There are other ways to do similar tasks such as git ls-tree and they may have more options. However I find these to be more accessible and easy to remember
Someone asked me today how to use WP_Query to get posts by a relative date. The codex provides an example on how to achieve this. Heres what is shown on the codex.