# ሐ  🩳 Fetch and Rebase Master the easy way

When fetching and rebasing the master/main/develop branch, you might use up to
four git commands. Here my Top-Down list, starting with the most
annoying:

## 👎🏽 4 commands

which can't be put in an alias without a parameter

``` bash
git checkout master
git fetch
git checkout feature/My-Nice-Feature-XYZ
git rebase master
```

## 👎🏽 4 commands

``` shell
git checkout master
git fetch
git checkout - # changing back to the last branch
git rebase master
```

## 👍🏽 2 commands
``` shell
git fetch origin master:master
git rebase master

# or
git fetch origin master:master && git rebase master
```

## 👍🏽 2 commands
``` shell
git fetch
git rebase origin/master

# or
git fetch && git rebase origin/master
```

## 🦄 1 command

after creating an alias

``` shell
git config --global alias.rma "!git fetch && git rebase origin/master"
git rma
```

Are there better ways to fetch and rebase master? Or even worse solutions?😉 Let me know in the comments

