For testing purpose I am trying to create a local bare repository like this:
FileRepositoryBuilder builder = new FileRepositoryBuilder();
Repository repository = builder.setGitDir(new File(remotePath))
.readEnvironment() // scan environment GIT_* variables
.findGitDir()
.build();
Of course when I try to clone I get an exception:
org.eclipse.jgit.api.errors.JGitInternalException: Invalid remote: origin
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:128)
I have probably to create a local emtpy repo then add a remote then push and then pull:
git init
git remote add origin remotepath
git pull origin master
What is the correct way to do this in jgit??
Thanks
Andrea