1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 20:22:07 +02:00
tldr/pages/common/git-rev-parse.md
Vitor Henrique c8f956319f
pages*: simplify page description (#12149)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-14 21:25:13 +01:00

16 lines
341 B
Markdown

# git rev-parse
> Display metadata related to revisions.
> More information: <https://git-scm.com/docs/git-rev-parse>.
- Get the commit hash of a branch:
`git rev-parse {{branch_name}}`
- Get the current branch name:
`git rev-parse --abbrev-ref {{HEAD}}`
- Get the absolute path to the root directory:
`git rev-parse --show-toplevel`