Cn - parent commit.
Cn+1(green) - local commit.
Cn+1(yellow) - another commit in same branch but already pushed to remote, but have same parent as local commit.
Result: I need to save all changes in local commit(green), but don't override changes in remote commits(yellow). So it look like save changes in local and remote commit relatively to parent, but green with high priority.
I can't do this with merge because it require manual stuff in interactive mode, I need to do it automatically from bash.