–Deploy on github pages
npx create-react-app app-name
cd app-name
npm install gh-pages –save-dev
modify: json file
“homepage”: “http://yourAccount.github.io/app-name”
scripts”: {
//…
“predeploy”: “npm run build”,
“deploy”: “gh-pages -d build”
}
git init
git remote add origin https://github.com/yourAccount/app-name.git
npm run deploy
git add .
git commit -m “First commit”
git push origin master
–update
git pull https://github.com/yourAccount/app-name.git
–reset pull origin sources
git remote set-url https://github.com/yourAccount/app-name.git
–choose one branch and clone
git clone -b master –single-branch https://github.com/yourAccount/app-name.git
–When there are conflicts , we need to use stash to slove merge problem.
git stash
git stash list
git stash pop 0
–Change branch
git branch
git branch checkout newBranch
觀看更多文章請點MRcoding筆記