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:
git commit -a --amend -C HEAD
. The HEAD commit hash has now changedgit 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.