这个问题在这里已经有了答案:CloneagitrepositoryintoanInMemoryRepositorywithJGit(3个答案)关闭3年前。我想创建一个Java程序,它连接到某个Git存储库,将文本附加到文件,promise并将更改推送到该存储库。理想情况下,所有这些都应该发生在内存中。我正在使用JGit与Git交互:InMemoryRepositoryrepo=newInMemoryRepository(newDfsRepositoryDescription());Gitgit=newGit(repo);git.init().call();PullCommandpull