How to make a git merge by pygit2
问题 I try to merge branch into master: repo = pygit2.Repository("/path/to/repo/") branch = repo.lookup_branch("upstream/branch", pygit2.GIT_BRANCH_REMOTE) oid = branch.target merge_result = repo.merge(oid) And merge_result contains ff oid (as in documentaion) and repo hasn't changed. What should I do next to change the repository? 回答1: The merge function does the merge (or in this case tells you you could skip it), but it's up to you (or the user of the tool) whether you want to move the current