Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i mostly use this to go from inside a repo up to the root:

  alias rr='cd $(git rev-parse --show-toplevel)'


This is certainly a viable alternative to requiring a project-specific environment variable. The downside is it can only succeed if $PWD is within the local git repo.

If this is the preferred approach, however, an alternative zsh definition for devhome could be:

  devhome () {
    cd $(git rev-parse --show-toplevel) && cd ./${~1}(/)
  }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: