git add . command not working

6,221

This is because the node_modules folder is not ignored and hence when we run git add . command git visit all your directory/files and sub directory/files which is not ignored in .gitignore hence it is taking so long time to process it as node_modules contains a large amount of files and folder.

Solution:

Create .gitignore file in root directory of project and add node_modules folder to file .gitignore

Share:
6,221

Related videos on Youtube

Rajat Verma
Author by

Rajat Verma

Full Stack Developer | Blockchain Enthusiast

Updated on September 18, 2022

Comments

  • Rajat Verma
    Rajat Verma over 1 year

    git add . is not working it got stuck as you can see the below image. I am building an expo project and the directory structure is in the image. Please help me with this problem.

    I also tried git add --all, git add -A none is working

    enter image description here

    • DavidPostill
      DavidPostill about 5 years
      Sorry, we can't accept images of code or errors. Post those as text, so that we can try to reproduce the problem without having to re-type everything, and your question can be properly indexed or read by screen readers.
    • Dmitry Shvetsov
      Dmitry Shvetsov over 4 years
      Try to add node_modules folder to gitignore echo "node_modules" >> .gitignore and then rerun git add ..
    • Rajat Verma
      Rajat Verma about 4 years
      @iamdi yes thats work.