3 ms·
I wish this existed for the git remote.
by gizdan 5y ago
I wish this existed for the git remote.
- thamer 5y agoWhat 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-Functions 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/6cb4e1664574212b125fbfd115fe90a4 https://gist.github.com/laggardkernel/6cb4e1664574212b125fbf...