# 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 ``` ![](https://i.imgur.com/cW98vTS.png) same for integration branch ![](https://i.imgur.com/UUwtJ2A.png) ## 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 ``` ![](https://i.imgur.com/u0l2L5g.png) ## 3. Run git rebase command Run `git rebase <base-branch>` ```bash $ git rebase main ``` ![](https://i.imgur.com/d4kEMA1.png) ## 4. Check for conflicts There are usually conflicts when the base branch commits are included ```bash $ git status -sb $ git status ``` ![](https://i.imgur.com/g7jMa1H.png) ## 5. Fix conflics In this case I have a conflict in `Status.vue` file ### 5.1 Solve all conflict marks **Before** ![](https://i.imgur.com/9CNLK2t.png) **After** ![](https://i.imgur.com/6EzqlnW.png) ### 5.2 Make sure you have local packages updated ```bash $ npm ci ``` ### 5.3 Run tests ```bash $ npm run test:unit ``` ![](https://i.imgur.com/NwPtWSQ.png) If any test are broken, fix it before continue ### 5.4 Check for compilation errors and lint warnings ```bash $ npm run serve ``` ![](https://i.imgur.com/c3J6q4l.png) ### 5.5 Add changes to git staging area ```bash $ git add . ``` ## 6. Continue the rebase process ```bash $ git rebase --continue ``` ![](https://i.imgur.com/PEoukaM.png) Repeat the process from step 4 until rebase were done ![](https://i.imgur.com/NTcmN7y.png) ## 7. Push rebased brach to remote ![](https://i.imgur.com/qZWWzJI.png) :::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 :::