## How to Rebase Onto Another Branch
Let’s try a `git rebase` example. We’ve got a project with a branch called `new-feature`. We’d `rebase` that branch onto the `master` branch like this.
First, we check that the `master` branch has no outstanding changes.
```
git status
```
We checkout the `new-feature` branch.
```
git checkout new-feature
```
We tell Git to `rebase` the current branch onto the master branch.
```
git rebase master
```
We can see that we have still got two branches.
```
git branch
```
We swap back to the `master` branch
```
git checkout master
```
We merge the new-feature branch into the current branch, which in our case is the `master` branch.
```
git merge new-feature
```
![The master branch with the new-feature rebased onto it](https:
Dave McKay/How-To Geek
Interestingly, we’ve still got two branches after the final merge.
![Using the Git branch command to list the branches in the git repository](https:
Dave McKay/How-To Geek
The difference is, now the head of the `new-feature` branch and the head of the `master` branch are set to point to the same commit, and the Git history doesn’t show there used to be a separate `new-feature` branch, apart from the branch label.
![The master branch with the dev-branch rebased onto it](https: