git reset commit_id with taxt dot无法通过jgit工作
我创建了带有三个提交的Git Repo:
commit 99c3de6f701ed9e60d8a2fa0f7c435bc738685dc (HEAD -> master, origin/master, origin/HEAD)
added c
commit 6a2e2b1fcb6cf54bb001c7f8618b623b10974cc2
added b
commit e68e2a7e491a627e52d3ba83027897f800344843
added a
in Git Shell git Reset E68E2A7E491A627E52D3BA83027897F800344843-。
将存储库重置为第一个提交,并保留所有历史记录,并保留所有历史记录,并在第三提案中掌握了所有的掌握。
我尝试使用JGIT开发相同的命令:
ResetCommand reset = git.reset();
reset.setRef("e68e2a7e491a627e52d3ba83027897f800344843");
reset.addPath(".");
reset.call();
但是JGIT命令具有不同的行为 - 它将主重置为第一个提交,并且丢失了一些历史记录:
commit e68e2a7e491a627e52d3ba83027897f800344843 (HEAD -> master)
added a
是一个错误还是我应该设计JGIT重置命令另一种获得所需行为的方法?
I created git repo with three commits:
commit 99c3de6f701ed9e60d8a2fa0f7c435bc738685dc (HEAD -> master, origin/master, origin/HEAD)
added c
commit 6a2e2b1fcb6cf54bb001c7f8618b623b10974cc2
added b
commit e68e2a7e491a627e52d3ba83027897f800344843
added a
In git shell git reset e68e2a7e491a627e52d3ba83027897f800344843 -- .
resets the repository to the first commit and keeps all history and HEAD point to MASTER at the third commit.
I've tried to develop the same command using JGIT:
ResetCommand reset = git.reset();
reset.setRef("e68e2a7e491a627e52d3ba83027897f800344843");
reset.addPath(".");
reset.call();
But JGIT command has different behavior - it resets MASTER to the first commit and some history lost:
commit e68e2a7e491a627e52d3ba83027897f800344843 (HEAD -> master)
added a
Is it a bug or I should design JGIT reset command another way to get required behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论