[!NOTICE]
This repository has been archived because this extension is not necessary — and may not have even been necessary when I wrote it. Instead of using this, I strongly recommend using
gh repo sync
.
Uses the GitHub API to update your fork of a repository to the current state of the parent repository.
In essence, this is a fancy wrapper around:
gh api repos/TARGET_REPO/merge-upstream -F branch=UPSTREAM_BRANCH
If there are insufficient permissions for your token, gh api
will advise the
correct action to take.
gh extension install halostatue/gh-merge-upstream
gh-merge-upstream
works best and easiest if you are in a local clone of the
target repository where origin
points to your fork and upstream
points to
the parent repository. In this case, gh-merge-upstream
will discover the
target upstream branch and the target repo and apply everything automatically.
In other cases, the target repository and/or the upstream repository must be specified.
gh-merge-upstream
takes one optional parameter, TARGET_REPO
, which is either
a URL to the repository (https://github.com/owner/repo
) or a shorthand
repository name (owner/repo
). If unspecified, it will be determined from the
handling of the origin
option, described below.
The name of the branch to use for updating your fork. Defaults to the 'upstream' repository default branch.
The name of the remote in the current git repo to use for discovering
TARGET_REPO
. Defaults to origin
.
The name of the remote (upstream
), shorthand repository name (owner/repo
),
or repository URL (https://github.com/owner/repo
) for the parent repository
and used only when --branch
is not provided. Defaults upstream
of the
current git repo.
- Austin Ziegler (@halostatue) created gh-merge-upstream.
- George L. Yermulnik (@yermulnik)