Sync your fork with upstream changes. Assumes upstream
is a remote with URLs configured.
git fetch upstream
git rebase upstream/<upstream-branch>
git push
Sync your local repository with remote changes. Will rewrite your local history via --rebase
.
git pull --rebase <remote> <branch>
Fetch the git history (i.e., .git
), but not the repository contents.
git clone --no-checkout <repository>
Fetch a remote branch.
git fetch <remote> <remote-branch>:<new-local-branch>
Reset local branch to match remote branch.
git checkout <local-branch>
git reset --hard <remote>/<remote-branch>