何时尝试执行以下方法(使用JGIT库)
private void pullRepo() throws IOException,GitAPIException, WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException, RefNotFoundException, NoHeadException{
Git git = new Git(localRepo);
git.pull().call();
}我得到以下运行时异常:
org.eclipse.jgit.api.errors.NoHeadException: Pull on repository without HEAD currently not supported
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:161)有人知道怎么解决这个问题吗?我使用的localRepo与我使用的cloneRepository方法相同,后者工作得很好。
谢谢,bgvv1983
发布于 2013-08-11 15:12:29
我想我发现了我的错误。在我的项目文件夹中放错了级别。
我在./project(在您的shell中工作)级别,而不是./project/..git级别。
https://stackoverflow.com/questions/17979660
复制相似问题