Skip to content

Instantly share code, notes, and snippets.

@jforge
Created February 9, 2023 12:15
Show Gist options
  • Select an option

  • Save jforge/d0c077cd841836b891c15d6242c430c2 to your computer and use it in GitHub Desktop.

Select an option

Save jforge/d0c077cd841836b891c15d6242c430c2 to your computer and use it in GitHub Desktop.
# https://git-scm.com/docs/git-rev-parse
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-toplevel
/Users/me/git/abc/
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-prefix
xyz/123/
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-cdup
../../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment