Skip to content Skip to sidebar Skip to footer

How Do I Programmatically Simulate Resolving A Merge Conflict With Gitpython?

As per my recent question on merging branches using GitPython, I'm trying to unit test the solution there. To do so I need to simulate a user opening their merge tool, resolving th

Solution 1:

I gave up trying to use the internals of GitPython on the grounds that trying to disentangle the relevent commands from the unit tests was proving rather tricky.

In the end, this worked:

g = git.Git('my/repo')
g.execute(["git","add","conflicted_file.txt"])
g.execute(["git","commit","-m", "Conflict resolved"])

Post a Comment for "How Do I Programmatically Simulate Resolving A Merge Conflict With Gitpython?"