git-sync - Man Page
Sync local branch with remote branch
Examples (TL;DR)
- Sync the current local branch with its remote branch:
git sync
- Sync the current local branch with the remote main branch:
git sync origin main
- Sync without cleaning untracked files:
git sync -s remote_name branch_name
Synopsis
Description
Sync local branch with <remote>/<branch>.
When <remote> and <branch> are not specified on the command line, upstream of local branch will be used by default.
All changes and untracked files and directories will be removed unless you add -s(--soft).
Options
- --soft or -s
- Add this flag if you want to preserve untracked files.
- --force or -f
- Add this flag to disable interaction.
Examples
Sync local branch with its upstream
$ git sync
Sync local branch with origin/master
$ git sync origin master
Sync without cleaning untracked files:
$ git sync -s origin master
Sync without interaction:
$ git sync -f
Author
Written by Takuma Yamaguchi <kumon0587@gmail.com>
Reporting Bugs
See Also
Referenced By
August 2022 Git Extras