# list remotes with URLs matching a regexp
list_remotes() {
GIT_REMOTES=""
+ local remote
for remote in `git remote`; do
if git config --get remote.$remote.url | grep -q "$1"; then
GIT_REMOTES="$GIT_REMOTES $remote"
fi
done
- unset remote
}
# completion for cdremote - list remotes with directories as URLs