-
Notifications
You must be signed in to change notification settings - Fork 0
Git
kitiya edited this page Jul 12, 2020
·
9 revisions
Creating a new branch & switching branches | Link
$ git branch <branch>
$ git checkout <branch>
$ git checkout -b <branch> // create and checkout
Push a new local branch to a remote Git repo | Link
$ git remote add origin <https://github.com/user_name/project_name.git>
$ git push -u origin <branch>
$ git config user.email
Merge a Git branch into master | Link
The best (and safest) way to merge a Git branch into master:
$ 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: