From 5cda8ace1a03900e60e982704e7b12104252ccdd Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Mon, 30 Sep 2019 15:16:34 -0400 Subject: [PATCH 1/2] :information_desk_person: add 'upstream' remote --- docs/contributors/git-workflow.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/contributors/git-workflow.md b/docs/contributors/git-workflow.md index 7f1499bc7de34a..00abdd9bcddb61 100644 --- a/docs/contributors/git-workflow.md +++ b/docs/contributors/git-workflow.md @@ -41,7 +41,18 @@ git push --force-with-lease your-branch-name ## Keeping Your Fork Up To Date -Working on pull request starts with forking the Gutenberg repository, your separate working copy. Which can easily go out of sync as new pull requests are merged into the main repository. Here your working repository is a `fork` and the main Gutenberg repository is `upstream`. When working on new pull request you should always update your fork before you do `git checkout -b my-new-branch` to work on a feature or fix. +Working on pull request starts with forking the Gutenberg repository, your separate working copy. Which can easily go out of sync as new pull requests are merged into the main repository. Here your working repository is a `fork` and the main Gutenberg repository is `upstream`. When working on new pull request you should always update your fork before you do `git checkout -b my-new-branch` to work on a feature or fix. + +You will need to add an `upstream` origin in order to keep your fork updated. + +```sh +git remote add origin upstream https://github.com/WordPress/gutenberg.git +git remote -v +origin git@github.com:your-account/gutenberg.git (fetch) +origin git@github.com:your-account/gutenberg.git (push) +upstream https://github.com/WordPress/gutenberg.git (fetch) +upstream https://github.com/WordPress/gutenberg.git (push) +``` To sync your fork you need to fetch the upstream changes and merge them into your fork. These are the corresponding commands: @@ -57,7 +68,7 @@ This will update you local copy to update your fork on github push your changes git push ``` -The above commands will update your `master` branch from _upstream_. To update any other branch replace `master` with the respective branch name. +The above commands will update your `master` branch from _upstream_. To update any other branch replace `master` with the respective branch name. ## References From f440820fdc6873901aafca91869ef3fee80aa533 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Mon, 30 Sep 2019 15:17:41 -0400 Subject: [PATCH 2/2] :bug: origin / remote --- docs/contributors/git-workflow.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributors/git-workflow.md b/docs/contributors/git-workflow.md index 00abdd9bcddb61..5fe7a79d556fa3 100644 --- a/docs/contributors/git-workflow.md +++ b/docs/contributors/git-workflow.md @@ -36,14 +36,14 @@ To sum it up, you need to fetch any new changes in the repository, rebase your b ```sh git fetch git rebase master -git push --force-with-lease your-branch-name +git push --force-with-lease origin your-branch-name ``` ## Keeping Your Fork Up To Date Working on pull request starts with forking the Gutenberg repository, your separate working copy. Which can easily go out of sync as new pull requests are merged into the main repository. Here your working repository is a `fork` and the main Gutenberg repository is `upstream`. When working on new pull request you should always update your fork before you do `git checkout -b my-new-branch` to work on a feature or fix. -You will need to add an `upstream` origin in order to keep your fork updated. +You will need to add an `upstream` remote in order to keep your fork updated. ```sh git remote add origin upstream https://github.com/WordPress/gutenberg.git