Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JGIT Pull NoHeadException

When is try to execute the following method (uses JGIT library)

 private void pullRepo() throws  IOException,GitAPIException, WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException, RefNotFoundException, NoHeadException{
            Git  git = new Git(localRepo);
            git.pull().call();
    }

I get the following runtime exception:

org.eclipse.jgit.api.errors.NoHeadException: Pull on repository without HEAD currently not supported
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:161)

Does someone know how to solve this? The localRepo I use is the same as I use for the cloneRepository method ,which works perfectly.

thanks, bgvv1983

like image 654
Bgvv1983 Avatar asked Jul 31 '13 19:07

Bgvv1983


1 Answers

Think I found my mistake. was on the wrong level in my project folder.

I was at the ../project (which works in your shell) level in stead of ../project/.git level.

like image 162
Bgvv1983 Avatar answered Sep 27 '22 19:09

Bgvv1983