Performing a “fast-forward” merge with Rugged

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 09:36:59

There is no need for an operation called "fast-forward merge" libgit2 since a so-called ff-merge is updating the current branch to whatever commit is on the other branch, which does exist.

repo.checkout_tree(other_branch.target)
repo.references.update(repo.head.resolve, other_branch.target_id)

will update the workdir to what the other side has, and then set the current branch to point to whatever the commit at the tip of the branch to "merge", which is what an ff does.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!