我阅读了在非裸存储库中暂存文件的问题和答案.但是,我正在使用裸存储库,我想要暂存文件.
我尝试使用DirCacheBuilder的测试,但代码Repository.lockDirCache()或Repository.readDirCache()失败,因为这是一个裸存储库.
org.eclipse.jgit.errors.NoWorkTreeException:Bare Repository在org.eclipse.jgit.dircache.DirCache上既没有工作树,也没有org.eclipse.jgit.lib.Repository.getIndexFile(Repository.java:993)的索引. .read(DirCache.java:166)org.eclipse.jgit.lib.Repository.readDirCache(Repository.java:1017)
那么,我怎样才能使用JGit在裸存储库中暂存文件?这有可能吗?
我怎么能使用JGit在裸存储库中暂存文件?
你不会,因为错误说明:
Bare Repository has neither a working tree, nor an index
Run Code Online (Sandbox Code Playgroud)
没有索引,意味着没有分期.
| 归档时间: |
|
| 查看次数: |
559 次 |
| 最近记录: |