Skip to content

Instantly share code, notes, and snippets.

@kena0ki
Last active March 22, 2020 05:42
Show Gist options
  • Save kena0ki/6fbeaf5442965e21227f059b93cf4ad8 to your computer and use it in GitHub Desktop.
Save kena0ki/6fbeaf5442965e21227f059b93cf4ad8 to your computer and use it in GitHub Desktop.
# https://help.github.com/en/github/getting-started-with-github/fork-a-repo
# https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
FORKREPO="$1"
ORIGINREPO="$2"
WORKDIR="$3"
git clone "$FORKREPO" "$WORKDIR" # clone forked repo
cd "$WORKDIR"
git remote -v # confirm current configuration
git remote add upstream "$ORIGINREPO" # add upstream
git remote -v # confirm if upstream is added
git fetch upstream # update local repo
git checkout master # switches to branch 'master'
git merge upstream/master # merge from upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment