As far as I know, git show remote origin
or git ls-remote
can achieve this to some extent. You might need to do some extra filtering or matching to get what you want.
The following is shown as an example:
$ git remote show origin
* remote origin
Fetch URL: git@10.88.1.128:Test
Push URL: git@10.88.1.128:Test
HEAD branch: master
Remote branches:
client tracked
develop tracked
index new (next fetch will store in remotes/origin)
master tracked
refs/remotes/origin/masster stale (use 'git remote prune' to remove)
server tracked
test tracked
Local branches configured for 'git pull':
masster merges with remote masster
master merges with remote master
Local ref configured for 'git push':
master pushes to master (local out of date)
The index
branch is newly created by others and not stored in local.
EDIT: a better example would be a newly created git repository with just remote url set and nothing else.
git ls-remote
:
$ git init
Initialized empty Git repository in /home/erix/gitRepos/test/.git/
$ git remote add origin git@10.88.1.128:Test
$ git ls-remote origin
215e658c07c0e667a73ec9247f0b98c90a4fe65a HEAD
4423ed26d1a74139997ed982cf42d681ea4eb248 refs/heads/client
1c3d2c2113d04d7771a5638729528d090d9a2eae refs/heads/develop
8277bdd3d37b9a7c02bead816efabc6849290dc1 refs/heads/index
215e658c07c0e667a73ec9247f0b98c90a4fe65a refs/heads/master
eb26276359ae355486536a4bfe5c939a5ab96fb0 refs/heads/server
62018d80b5d279ee2cbe8175a0bde30121288045 refs/heads/test
git remote show
:
$ git remote show origin
* remote origin
Fetch URL: git@10.88.1.128:Test
Push URL: git@10.88.1.128:Test
HEAD branch: master
Remote branches:
client new (next fetch will store in remotes/origin)
develop new (next fetch will store in remotes/origin)
index new (next fetch will store in remotes/origin)
master new (next fetch will store in remotes/origin)
server new (next fetch will store in remotes/origin)
test new (next fetch will store in remotes/origin)