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

What do you mean exactly?

If you want to trigger some specific behavior per directory, have a look at `chpwd` for zsh, it's a function you can redefine that gets called every time you enter a new directory. You could for example have a chpwd function that checks if you're under ~/work, if there's a .git directory, and then adjust the remotes as you wish.

chpwd docs: https://zsh.sourceforge.io/Doc/Release/Functions.html#Hook-F...

This gist seems to describe a technique for achieving the same thing with bash (I haven't tried it): https://gist.github.com/laggardkernel/6cb4e1664574212b125fbf...



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

Search: