Hi,
with recent switch to GH I made myself a little helper to sync fork and rebase your branch
on top of that. Hopefully someone will find it useful. The usage is "./script.sh $NAME_OF_MASTER" (usually master for gerrit projects, newer GH have main).
#!/bin/bash -e
ORIGIN=$(git branch --show-current)
# Go to master/main/base (gco)
git checkout $1
# Fetch all remotes (gfa)
git fetch --all --prune
# Merge upstream remote into master/main/base (gm)
git merge upstream/$1
# Push master/main/base into origin (gp)
git push origin $(git branch --show-current)
# Switch back to previous branch (gco)
git checkout $ORIGIN
# Rebase the branch (gl)
git pull --rebase
Best regards,
Ales