mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-11 02:47:13 +00:00
Update cheatsheets
This commit is contained in:
21
git-rev-parse
Normal file
21
git-rev-parse
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# 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`
|
||||
Reference in New Issue
Block a user