This is my code for add remote.
FileRepositoryBuilder builder = new FileRepositoryBuilder();
Repository repository = builder.setGitDir(gitdir)
.readEnvironment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build();
Git git = new Git(repository);
StoredConfig config = git.getRepository().getConfig();
config.setString("remote", "origin", "url", url);
config.save();
Now how to use fetch command using jGit?