Add remote via JGit

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 ?

To remove I do the following:

StoredConfig config = git.getRepository().getConfig();
config.unsetSection("remote", "origin");;

But there's no a option like #setSection(String, String).

Thanks in advance.


Managed it to work that way:

Git git = new Git(localRepository);
StoredConfig config = git.getRepository().getConfig();
config.setString("remote", "origin", "url", "");;

And aparently it works like a boss.

There are classes to add new ones:

    RemoteAddCommand remoteAddCommand = git.remoteAdd();
    remoteAddCommand.setUri(new URIish(""));;

There is a RemoteSetUrlCommand too.

Need Your Help

Sorting a pandas series

python pandas sorting series

I am trying to figure out how to sort the Series generated as a result of a groupby aggregation in a smart way.