# Rebase simple strategy
###### tags: `rebase` `git`
## Content
[ToC]
## 1. Make sure both branches are updated
Check base branch and integration branch are updated
```bash
$ git fetch
$ git status
$ git pull
```

same for integration branch

## 2. Create a branch from the integration branch
In this example the branch will be `rebase/pegout-status-integration`
```bash
$ git checkout -b rebase/pegout-status-integration
```

## 3. Run git rebase command
Run `git rebase <base-branch>`
```bash
$ git rebase main
```

## 4. Check for conflicts
There are usually conflicts when the base branch commits are included
```bash
$ git status -sb
$ git status
```

## 5. Fix conflics
In this case I have a conflict in `Status.vue` file
### 5.1 Solve all conflict marks
**Before**

**After**

### 5.2 Make sure you have local packages updated
```bash
$ npm ci
```
### 5.3 Run tests
```bash
$ npm run test:unit
```

If any test are broken, fix it before continue
### 5.4 Check for compilation errors and lint warnings
```bash
$ npm run serve
```

### 5.5 Add changes to git staging area
```bash
$ git add .
```
## 6. Continue the rebase process
```bash
$ git rebase --continue
```

Repeat the process from step 4 until rebase were done

## 7. Push rebased brach to remote

:::info
**Note:**
`pegout-status-integration` should be overwritten by `rebase/pegout-status-integration`. This requires a `git push --force` that only can be performed by write-access users
:::