my favorite one-liner to update a local git branch
When working on a long-lived feature branch, it is often helpful to keep up-to-date with the main branch. The following one-liner typically satisfies that need in my workflow:
git pull --autostash --rebase origin main This command is very handy because it:
Pulls the remote branch. Rebases your changes on top of the main branch. Stashes any local changes you may not have committed yet. The equivalent consists of the following commands: