Giter VIP home page Giter VIP logo

remove-node-modules-from-git-repository's Introduction

How to remove node_modules from git repository

Git methods #How to remove node_modules from git repo.

  1. Check for an existing .gitignore file in the project directory
ls -a
  1. If your project directory has a .gitignore file -skip step 3. Otherwise, continue with:

create .gitignore file in the git repository

touch .gitignore

Remove the node_modules directory

3.Open up the .gitignore and add the following line to the file

**/node_modules
  1. Remove the node_modules folder from the git repository
git rm -r --cached node_modules (it take some time to clean up)

Commit All changes

5- finally Commit all changes

git commit -m "Removed node_modules folder"

6- Push the chnages to the remote repo

git push origin main

7-Commit the .gitignore file

git add .gitignore
git commit -m "Updated the .gitignore file"
git push origin main

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.