-
Notifications
You must be signed in to change notification settings - Fork 0
Git
kitiya edited this page Mar 21, 2020
·
9 revisions
The best (and safest) way to merge a Git branch into master: stackoverflow
git checkout master
git pull origin master
git merge test
git push origin master
Create React App uses the homepage field to determine the root URL in the built HTML file.
"homepage": "https://myusername.github.io/my-app",
Now, whenever you run npm run build, you will see a cheat sheet with instructions on how to deploy to GitHub Pages.
To publish it at https://myusername.github.io/my-app, run:
npm install --save gh-pages
Add the following scripts in your package.json:
"scripts": {
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
The predeploy script will run automatically before deploy is run.
npm run deploy
Finally, make sure GitHub Pages option in your GitHub project settings (in the source section) is set to use the gh-pages branch: