**This page is mainly intended for MDLs, which have to deal with merge conflicts in Gerrit.**
## Simple Rebase using Gerrit UI
@@ -19,59 +18,65 @@ You can specify the parent revision where to rebase. The defaults are:
## When "Rebase" button is not enough
In other cases, some choices and updates need be done manually to resolve the conflicts that cannot be done using the Gerrit UI. **We strongly recommend the use of "git-review" tool**, as described in **[this link](https://osm.etsi.org/wikipub/index.php/Using_git-review_to_push_and_review_changes)**.
In other cases, some choices and updates need be done manually to resolve the conflicts that cannot be done using the Gerrit UI. **We strongly recommend the use of `git-review` tool**, as described in **[the next section](09-01-04-git-review.md)**.
Optionally, you can use git and these steps to resolve the conflict manually and update the commit on Gerrit so it can be merged. The following steps assume that the commit is against master branch. You will have to change master to the right branch, if you are trying to review a different branch.
Optionally, you can use `git` and these steps to resolve the conflict manually and update the commit on Gerrit so it can be merged. The following steps assume that the commit is against master branch. You will have to change master to the right branch, if you are trying to review a different branch.
\1. Get the last code from the repository. **Note**: use the appropriate branch instead of master
### 1. Get the last code from the repository. **Note**: use the appropriate branch instead of master
```
```bash
git checkout master
git pull origin master
```
\2. Create a new branch to work on the code with conflicts. You can use the review number and patchset as name.
### 2. Create a new branch to work on the code with conflicts. You can use the review number and patchset as name
```
```bash
git checkout -b <review-number>-<patchset>
```
\3. Pull the patch on the created branch. (To find the command to execute you can open the corresponding change page on Gerrit UI, click on download menu, then copy the "pull" command.)
### 3. Pull the patch on the created branch
```
(To find the command to execute you can open the corresponding change page on Gerrit UI, click on download menu, then copy the `pull` command.)
```bash
git pull <url> <ref>
```
\4. Make a rebase of your branch against master. **Note**: use the appropriate branch instead of master
### 4. Make a rebase of your branch against master
```
**Note**: use the appropriate branch instead of master
```bash
git rebase master
```
\5. Fix all conflicts that cannot be resolved manually using your editor.
### 5. Fix all conflicts that cannot be resolved manually using your editor
\6. Add all updated files to the index.
### 6. Add all updated files to the index
```
```bash
git add <file>
```
**Note**: You can use git-status to make sure that conflicts are solved
**Note**: You can use `git-status` to make sure that conflicts are solved
```
```bash
git status
```
\7. Continue the rebase process using the following command
### 7. Continue the rebase process using the following command
```
```bash
git rebase --continue
```
\8. Submit your change back to the repository. **Note**: use the appropriate branch instead of master
### 8. Submit your change back to the repository
```
**Note**: use the appropriate branch instead of master
```bash
git push origin HEAD:refs/for/master
```
\9. Go back to Gerrit UI. You will find the change waiting for review.
### 9. Go back to Gerrit UI. You will find the change waiting for review