Hokay, to answer the actual question (instead of the one I saw-what-I-expected-to-see from the examples):
git config --local --get-regexp "^remote\\.$yourname\\.url" >&- \
&& echo it\'s a remote
should serve nicely. I carry aliases for frequently-used option combos, the one I'd be using here is
git config --global alias.grl '!f() { git config --local --get-regexp "${@-.}"; }; f'
so the test I'd actually use for my own work would be
git grl "^remote\\.$yourname\\.url" >&- && echo it\'s a remote
To test for a remote-tracking-branch name, the question I answered on my first attempt, it's
[[ `git rev-parse --symbolic-full-name $anything` = refs/remotes/* ]] \
&& echo it\'s a remote
or
case `git rev-parse --symbolic-full-name $anything` in
refs/remotes/*) echo yes ;;
esac
if you you're not using bash
.