Bgv*_*983 9 java eclipse git egit jgit
何时尝试执行以下方法(使用JGIT库)
private void pullRepo() throws IOException,GitAPIException, WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException, RefNotFoundException, NoHeadException{
Git git = new Git(localRepo);
git.pull().call();
}
Run Code Online (Sandbox Code Playgroud)
我得到以下运行时异常:
org.eclipse.jgit.api.errors.NoHeadException: Pull on repository without HEAD currently not supported
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:161)
Run Code Online (Sandbox Code Playgroud)
有人知道如何解决这个问题吗?我使用的localRepo与我用于cloneRepository方法的方法相同,完全正常.
谢谢,bgvv1983