From: Oleg Broytman Date: Thu, 7 Jul 2016 15:26:52 +0000 (+0300) Subject: .shellrc: add function cdremote X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=49c1bdaa8e0f3481f0e89feebe80d113d66b46d0;p=dotfiles.git .shellrc: add function cdremote Change current directory to a remote's directory (if the remote is on the local FS). --- diff --git a/.shellrc b/.shellrc index 860ba44..1ac77cf 100644 --- a/.shellrc +++ b/.shellrc @@ -164,6 +164,14 @@ KillAll() { } +# git-related + +# chdir to a remote's directory (if the remote is on the local FS) +cdremote() { + cd "`git config --get remote.$1.url`" +} + + include() { cfg="$1"