Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by jakub_g

4 days ago

FYI: you may want to check `git rev-parse --show-cdup`

- in root of the repo, it prints empty string

- if you're 1 level deep it prints `../`

- if you're 2 levels deep it prints `../../`

One minor drawback: inside `.git` subfolder, it always prints empty string too.

0 comments

jakub_g

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities