Provide automated solutions for "Update fork" when there are merge conflicts
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=462397) </details> <!--IssueSummary end--> <!-- The first section "Release notes" is required if you want to have your release post blog MR auto generated. Currently in BETA, details on the **release post item generator** can be found in the handbook: https://about.gitlab.com/handbook/marketing/blog/release-posts/#release-post-item-generator and this video: https://www.youtube.com/watch?v=rfn9ebgTwKg. The next four sections: "Problem to solve", "Intended users", "User experience goal", and "Proposal", are strongly recommended in your first draft, while the rest of the sections can be filled out during the problem validation or breakdown phase. However, keep in mind that providing complete and relevant information early helps our product team validate the problem and start working on a solution. --> ### Release notes <!-- What is the problem and solution you're proposing? This content sets the overall vision for the feature and serves as the release notes that will populate in various places, including the [release post blog](https://about.gitlab.com/releases/categories/releases/) and [Gitlab project releases](https://gitlab.com/gitlab-org/gitlab/-/releases). " --> It's easier to update your fork when there are merge conflicts. Two automated solutions are now provided. The first is rebase your changes i.e. "git pull --rebase" and the second is to discard your change and mirror the upstream branch. ### Problem to solve <!-- What problem do we solve? Try to define the who/what/why of the opportunity as a user story. For example, "As a (who), I want (what), so I can (why/value)." --> Some projects like [cki-project / kernel-ark · GitLab](https://gitlab.com/cki-project/kernel-ark) will rebase to upstream (Linux kernel) very often and most of times updating fork will have conflicts to resolve. As a developer, I want to have a easy way to update my fork. In fact, for large projects, manually resolving conflicts doesn't even work because there are so many changes that GitLab Serve fails with "`500 Internal Server Error`", ``` Enumerating objects: 3256163, done. Counting objects: 100% (2918825/2918825), done. Delta compression using up to 8 threads Compressing objects: 100% (571359/571359), done. Writing objects: 100% (2851260/2851260), 715.67 MiB | 2.08 MiB/s, done. Total 2851260 (delta 2432650), reused 2684467 (delta 2271845), pack-reused 0 remote: Resolving deltas: 100% (2432650/2432650), completed with 39525 local objects. remote: Checking connectivity: 2851129, done. remote: GitLab: 500 Internal Server Error To gitlab.com:baoquan_he/kernel-ark.git ``` ### Intended users <!-- Who will use this feature? If known, include any of the following: types of users (e.g. Developer), personas, or specific company roles (e.g. Release Manager). It's okay to write "Unknown" and fill this field in later. Developers who contribute to projects that rebase to upstream very often. ### Proposal <!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey --> When merge conflicts are detected after an user clicks the "Update fork" button, two solutions without manually resolving the conflicts will be offered. The first to rebase fork's changes and the second is to discard fork's changes. Btw, GitHub already provides an automated solution, ![Screenshot_2024-05-17_18-20-14](/uploads/8dd1d3ab9b81ac743c1c487cf8c2e149/Screenshot_2024-05-17_18-20-14.png)
issue