Sync current branch with main/master (fetch, checkout, pull, rebase).
Sync the current branch with the main/master branch.
# Current branch
git branch --show-current
# Default branch
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
# Current status
git status --short
git fetch origin
If on a feature branch: Rebase onto main/master
git rebase origin/main # or origin/master
If on main/master: Just pull
git pull --rebase origin main
If rebase conflicts occur:
git rebase --abortReport: