แˆ ๐Ÿฉณ Fetch and Rebase Master the easy way

Git Shorts

ยท

1 min read

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

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

๐Ÿ‘Ž๐Ÿฝ 4 commands

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

๐Ÿ‘๐Ÿฝ 2 commands

git fetch origin master:master
git rebase master

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

๐Ÿ‘๐Ÿฝ 2 commands

git fetch
git rebase origin/master

# or
git fetch && git rebase origin/master

๐Ÿฆ„ 1 command

after creating an alias

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