git-sync-upstream is a CLI to sync git upstream remote branches and tags with the local clone and origin remote.
git-sync-upstream is distributed on PyPI. It requires Python 3.7+. To install:
$ python -m pip install git-sync-upstream
Change directory to the git project to sync. The project must have a remote named upstream and origin. The remote upstream will be used to sync _from. Its branches and tags will be synced locally and _to origin.
$ cd myproject
# To sync the current branch
$ git-sync-upstream
# To sync all branches
$ git-sync-upstream --all
It is convenient to add a git alias to the command:
$ git config --global alias.sync "!git-sync-upstream"
Then:
$ cd myproject
# To sync the current branch
$ git sync
# To sync all branches
$ git sync --all