Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.
This repository was archived by the owner on May 5, 2021. It is now read-only.

How to patch? #1

Description

@jimthedev

You can apply our changes to create-react-app by downloading this patch file to your computer then using the steps to apply it using the information below:

sps-create-react.patch.zip

Taken from https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/


Applying the patch
… who will apply the patch you just sent! But, before you do that, there are some other steps you should take.

First, take a look at what changes are in the patch. You can do this easily with git apply

git apply --stat fix_empty_poster.patch

Note that this command does not apply the patch, but only shows you the stats about what it’ll do. After peeking into the patch file with your favorite editor, you can see what the actual changes are.

Next, you’re interested in how troublesome the patch is going to be. Git allows you to test the patch before you actually apply it.

git apply --check fix_empty_poster.patch

If you don’t get any errors, the patch can be applied cleanly. Otherwise you may see what trouble you’ll run into. To apply the patch, I’ll use git am instead of git apply. The reason for this is that git am allows you to sign off an applied patch. This may be useful for later reference.

git am --signoff < fix_empty_poster.patch

Applying: Added specs to test empty poster URL behaviour
Applying: Added poster URL as part of cli output
Okay, patches were applied cleanly and your master branch has been updated. Of course, run your tests again to make sure nothing got borked.

In you git log, you’ll find that the commit messages contain a “Signed-off-by” tag. This tag will be read by Github and others to provide useful info about how the commit ended up in the code.

Once you have applied the patch at the root of the git repo:

cd packages/react-scripts

Edit package.json to have the version you wish to publish

npm publish

(make sure you have access to publish to artifactory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions