I would like to create a test case that solves a rebase conflict, but first I need a way to cause the rebase conflict when doing a git pull --rebase.
Is there a programmatic way of creating a rebase conflict scenario?
The test will be for a GitPython program.
To quickly create a rebase conflict, you can do the following:

modify a file, commit and push to the remote repository
make a change to the same file on the same line
amend the last commit with git commit -a --amend -C HEAD. The HEAD commit hash has now changed
run git pull --rebase

You'll end up with a conflict at the line you modified.
To clean up: you may want to git reset --hard origin/[your-branch] after your test to get back to step 1.
How to create a git pull --rebase conflict for testcase?