Git repository configuration can be accessed via Repository::getConfig(). Return Type - StoredConfig.
To get the remote source url use this snippet
String url = repository.getConfig().getString("remote", "origin", "url");
The class ConfigConstantslists a set of commonly used section names and value names.
source
share