notes/devops/vcs/git/show/show.txt
Ihar Hancharenka b9c36c1e5a m
2024-02-04 19:40:05 +03:00

39 строки
647 B
Plaintext

check git-hashes.txt here
git show
show commits
git show <hash>
show a WHOLE commit (or something else) of the hash
git show <hash>:FILE
.. just a specific FILE
REF:FILE
blob spec
:0:FILE
index (staging area)
:1:FILE
common ancestor, find by a merge base
:2:FILE
target (on a current branch that you're on)
:3:FILE
the one you're bringing in (with merge)
show <some-branch>:<file>
show a <file> from <some-branch> without switching to it
samples:
# HEAD
$ git show HEAD:path/to/file
# INDEX
$ git show :path/to/file
# local
$ git show <branch>:path/to/file
# remote
$ git show origin/master:path/to/file