List of usage examples for org.eclipse.jgit.transport RemoteConfig setMirror
public void setMirror(boolean m)
From source file:com.netbeetle.reboot.git.CachedRepository.java
License:Apache License
public void init() throws IOException, URISyntaxException { if (exists()) { return;//from w w w . j av a 2 s . c o m } repository.create(true); StoredConfig config = repository.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(config, "origin"); remoteConfig.addURI(new URIish(uri)); remoteConfig.setMirror(true); remoteConfig.addFetchRefSpec(new RefSpec().setForceUpdate(true).setSourceDestination("refs/*", "refs/*")); remoteConfig.update(config); config.save(); }