This script helps you create a remote to a contributor's fork of the Angular repo, fetches the person's work, and checks out a new branch for you.
- Download this repo. Important: Store this directory at the same level as the Angular directory, not within your Angular clone.
- Go to terminal into the
add-remote
directory. - Type
chmod +x add-remote.sh
- Go back into your Angular directory.
- To run the script, type
../add-remote/add-remote.sh
- The user's GitHub handle.
For example, mine is
kapunahelewong
. - The name of the person's branch as it appears on their fork.
For example, in this URL:
https://github.com/kapunahelewong/angular/tree/patch-1
, my branch name ispatch-1
. You can see this in their PR under the PR title; for example,kapunahelewong:patch-1
. - What you plan on calling this branch on your computer.
Since
patch-1
is a common branch name, you might like to refer to it in a way that differentiates it from otherpatch-1
branches. While you could call itpatch-1
, You could also call it something different such askw-patch-1
orkapunahele-patch-1
.
Here's a screenshot of me answering these questions with these example answers:
When you're done editing, amending a commit, or rebasing use git push
to update the PR.
If you have used a unique name for the local version of the branch, git will give you an option of two commands.
Use the first command which be like this in our case:
git push kapunahelewong HEAD:patch-1
Thanks to @gkalpak for teaching me how to checkout contributor branches! ๐