Skip to content

Handle failed push if branch diverges

While editing files in the multi-file editor, other users may commit changes to the same branch, causing the working state to be diverged from the server. This could create a situation where your changes overwrite the other changes.

It is important the the repo editor:

  • does not allow the user to overwrite other users changes
  • does not cause the user to lose their pending changes

We should add last_commit_id to the API so that the server can reject the change (https://gitlab.com/gitlab-org/gitlab-ce/issues/38356).

We should make sure the interface handles this gracefully.

Proposal

  • If branches diverge and the server rejects the push, the multi file editor should allow the user to create a new branch

Designs

modal_copy

Edited by Dimitrie Hoekstra