When calling repo.git.rebase('origin/master') and the command fails, a GitCommandError is thrown. But the command's output is not captured there because it seems like git rebase always prints to stdout.
My suggestion is to add a stdout variable to GitCommandError to capture this output, too.