Skip to content

Instantly share code, notes, and snippets.

View Milad-mosadegh's full-sized avatar

Milad Mosadegh Milad-mosadegh

View GitHub Profile
@ciamac-da
ciamac-da / gist-09-github-deployment-react.txt
Last active September 1, 2021 10:33
This is how to deployment React projects on Github
1- Open package.json file and add a homepage at the top before name
==> "homepage": "https://<USERNAME>.github.io/<PROJECT NAME>",
2- install gh-pages using ==> npm i gh-pages
3- Add pre-deploy and deploy to scripts field in package.json file ==>
"pre-deploy": "npm run build",
"deploy": "gh-pages -d build"
4- type npm run pre-deploy in terminal
@ciamac-da
ciamac-da / gist-08-github-deployment-vanilla-javascript.txt
Last active July 11, 2021 12:13
Github Deployment for Vanilla JavaSript Repos
1- Add a new branch in your Project useing ==> git checkout -b gh-pages
2- Try to change at least one character of your project's files and save(you need this to be able to push again)
3- git add -A
4- git commit -am "deployment branch added"
5- git push --set-upstream origin gh-pages
@ciamac-da
ciamac-da / gist-01-remove-node_modules.txt
Created June 22, 2021 12:50
How to get rid of node_modules folder from Github
# This is how to get rid of node_modules folder from Github!
1- Add .gitignore file(must be located in the root directory of your repo).
2- Write node_modules/ in .gitignore file.
It means ignore all directories called node_modules in current folder and any subfolders.
As alternative you can also use /node_modules or **/node_modules.
** is used for a recursive call in the whole project.
3- Open Terminal