I playing around JGit, I could successfully remove a remote from some repository (git remote rm origin
), how can I do a git remote add origin http://github.com/user/repo
?
To remove I do the following:
StoredConfig config = git.getRepository().getConfig();
config.unsetSection("remote", "origin");
config.save();
But there's no a option like #setSection(String, String)
.
Thanks in advance.