Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_show [2018/02/07 16:17] – [Showing a file in the current directory] rpjday | git_show [2019/02/24 08:17] (current) – [Showing the staged version of a file] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | The '' | + | The '' |
| + | * commits | ||
| + | * trees | ||
| + | * tags | ||
| + | * blobs | ||
| + | |||
| + | In addition, '' | ||
| ===== Showing a commit ===== | ===== Showing a commit ===== | ||
| Line 79: | Line 85: | ||
| </ | </ | ||
| - | ===== Showing a file ===== | + | ==== Extremely concise |
| - | ==== Showing some version of a root directory | + | < |
| + | $ git show --oneline | ||
| + | 15d8ffc96464 (HEAD) Merge tag ' | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Showing files ===== | ||
| + | |||
| + | ==== The general form ==== | ||
| + | |||
| + | < | ||
| + | $ git show < | ||
| + | </ | ||
| + | ==== Showing some historical | ||
| - | Regardless of your current working directory: | + | Regardless of your current working directory, //show relative to the root of the repository// |
| < | < | ||
| Line 89: | Line 108: | ||
| $ git show master: | $ git show master: | ||
| $ git show topic: | $ git show topic: | ||
| - | $ git show v4.12:Makefile | + | $ git show v4.19: |
| + | $ git show 2241b8bcf2b5f1b01ebb1cbd1231bbbb72230064:Makefile | ||
| </ | </ | ||
| ==== Showing a file in the current directory ==== | ==== Showing a file in the current directory ==== | ||
| + | |||
| + | You need to use the '' | ||
| < | < | ||
| + | $ cd scripts/ | ||
| $ git show HEAD: | $ git show HEAD: | ||
| - | $ git show v4.12:./Makefile | + | $ git show v4.19:./Makefile |
| </ | </ | ||
| ==== Showing the staged version of a file ==== | ==== Showing the staged version of a file ==== | ||
| + | |||
| + | If you leave off the commit part, you're referring to the state of the file in the index: | ||
| < | < | ||