git status is not showing my changed files









up vote
0
down vote

favorite












I have a Node.js project and have imported a few Node modules. The git_status command shows the files that I changed in the project. I have also changed some files under the node_modules directory but those are not shown. The node_modules directory is shown as untracked.



Untracked files:
(use "git add <file>..." to include in what will be committed)

node_modules/
src/js/main-release-paths.json


I have changed only one file in node_modules:



node_modules/@oracle/grunt-oraclejet/node_modules/@oracle/oraclejet-tooling/lib/serve/connect.js


How can I track this file?










share|improve this question























  • I really don't understand the question...
    – OznOg
    Nov 11 at 15:49














up vote
0
down vote

favorite












I have a Node.js project and have imported a few Node modules. The git_status command shows the files that I changed in the project. I have also changed some files under the node_modules directory but those are not shown. The node_modules directory is shown as untracked.



Untracked files:
(use "git add <file>..." to include in what will be committed)

node_modules/
src/js/main-release-paths.json


I have changed only one file in node_modules:



node_modules/@oracle/grunt-oraclejet/node_modules/@oracle/oraclejet-tooling/lib/serve/connect.js


How can I track this file?










share|improve this question























  • I really don't understand the question...
    – OznOg
    Nov 11 at 15:49












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a Node.js project and have imported a few Node modules. The git_status command shows the files that I changed in the project. I have also changed some files under the node_modules directory but those are not shown. The node_modules directory is shown as untracked.



Untracked files:
(use "git add <file>..." to include in what will be committed)

node_modules/
src/js/main-release-paths.json


I have changed only one file in node_modules:



node_modules/@oracle/grunt-oraclejet/node_modules/@oracle/oraclejet-tooling/lib/serve/connect.js


How can I track this file?










share|improve this question















I have a Node.js project and have imported a few Node modules. The git_status command shows the files that I changed in the project. I have also changed some files under the node_modules directory but those are not shown. The node_modules directory is shown as untracked.



Untracked files:
(use "git add <file>..." to include in what will be committed)

node_modules/
src/js/main-release-paths.json


I have changed only one file in node_modules:



node_modules/@oracle/grunt-oraclejet/node_modules/@oracle/oraclejet-tooling/lib/serve/connect.js


How can I track this file?







node.js git github node-modules






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 20:00









Adam Liss

40.4k1193130




40.4k1193130










asked Nov 11 at 15:45









Chirayu Chirayu

156




156











  • I really don't understand the question...
    – OznOg
    Nov 11 at 15:49
















  • I really don't understand the question...
    – OznOg
    Nov 11 at 15:49















I really don't understand the question...
– OznOg
Nov 11 at 15:49




I really don't understand the question...
– OznOg
Nov 11 at 15:49












5 Answers
5






active

oldest

votes

















up vote
1
down vote













Assuming you have git repo, Please check the .gitignore files inside your project. Entries in .gitignore will be ignored by Git and will not show up when you do git add.






share|improve this answer
















  • 1




    ... But the asker does see it in git status so it obviously is not ignored.
    – ohlec
    Nov 11 at 16:10

















up vote
1
down vote













You shouldn't add the node_modules folder to git then it's managed bei the npm command. So remove that folder and use the npm install command.



When you have added something in that folder it's shown as changed, if you had first added some files. So i hop that folder is in your .gitignore file and ignored. You should check that.






share|improve this answer



























    up vote
    0
    down vote













    Adding the file to track



    This is most likely not a suitable approach (read below). However , if you really want to do it:



    In order to track a file nested under node_modules, you should add the directory. All of its content will be staged in git



    git add node_modules


    Recommended approach



    You probably don't want to track the contents of node_modules directory, because:



    • running npm install will wipe your your changes

    • hundreds or thousand files are likely to end up present in that directory

    • tracking package.json and package-lock.json in git is sufficient, then populate node_modules using npm install command.

    You are not supposed to modify files located in node_modules directory directly. Instead, fork the module in question, modify it, and:



    • either publish your own version in npm

    • or reference it as a git repository inside package.json (how-to)

    Then, also add node_modules directory to the .gitignore file.






    share|improve this answer



























      up vote
      0
      down vote













      If the whole directory is untracked, git status will show only the directory. Because it's untracked, there is no meaningful difference to git between changed and unchanged files in there.



      Other answers have already addressed that tracking node_modules is nota good idea. Of you want to track your changes to modules, consider cloning the module repo and including it as a git submodule.






      share|improve this answer



























        up vote
        0
        down vote













        It should be inside .gitignore file. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.






        share|improve this answer




















          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250383%2fgit-status-is-not-showing-my-changed-files%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Assuming you have git repo, Please check the .gitignore files inside your project. Entries in .gitignore will be ignored by Git and will not show up when you do git add.






          share|improve this answer
















          • 1




            ... But the asker does see it in git status so it obviously is not ignored.
            – ohlec
            Nov 11 at 16:10














          up vote
          1
          down vote













          Assuming you have git repo, Please check the .gitignore files inside your project. Entries in .gitignore will be ignored by Git and will not show up when you do git add.






          share|improve this answer
















          • 1




            ... But the asker does see it in git status so it obviously is not ignored.
            – ohlec
            Nov 11 at 16:10












          up vote
          1
          down vote










          up vote
          1
          down vote









          Assuming you have git repo, Please check the .gitignore files inside your project. Entries in .gitignore will be ignored by Git and will not show up when you do git add.






          share|improve this answer












          Assuming you have git repo, Please check the .gitignore files inside your project. Entries in .gitignore will be ignored by Git and will not show up when you do git add.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 15:53









          dresh

          284814




          284814







          • 1




            ... But the asker does see it in git status so it obviously is not ignored.
            – ohlec
            Nov 11 at 16:10












          • 1




            ... But the asker does see it in git status so it obviously is not ignored.
            – ohlec
            Nov 11 at 16:10







          1




          1




          ... But the asker does see it in git status so it obviously is not ignored.
          – ohlec
          Nov 11 at 16:10




          ... But the asker does see it in git status so it obviously is not ignored.
          – ohlec
          Nov 11 at 16:10












          up vote
          1
          down vote













          You shouldn't add the node_modules folder to git then it's managed bei the npm command. So remove that folder and use the npm install command.



          When you have added something in that folder it's shown as changed, if you had first added some files. So i hop that folder is in your .gitignore file and ignored. You should check that.






          share|improve this answer
























            up vote
            1
            down vote













            You shouldn't add the node_modules folder to git then it's managed bei the npm command. So remove that folder and use the npm install command.



            When you have added something in that folder it's shown as changed, if you had first added some files. So i hop that folder is in your .gitignore file and ignored. You should check that.






            share|improve this answer






















              up vote
              1
              down vote










              up vote
              1
              down vote









              You shouldn't add the node_modules folder to git then it's managed bei the npm command. So remove that folder and use the npm install command.



              When you have added something in that folder it's shown as changed, if you had first added some files. So i hop that folder is in your .gitignore file and ignored. You should check that.






              share|improve this answer












              You shouldn't add the node_modules folder to git then it's managed bei the npm command. So remove that folder and use the npm install command.



              When you have added something in that folder it's shown as changed, if you had first added some files. So i hop that folder is in your .gitignore file and ignored. You should check that.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 11 at 15:54









              Stony

              19.7k135164




              19.7k135164




















                  up vote
                  0
                  down vote













                  Adding the file to track



                  This is most likely not a suitable approach (read below). However , if you really want to do it:



                  In order to track a file nested under node_modules, you should add the directory. All of its content will be staged in git



                  git add node_modules


                  Recommended approach



                  You probably don't want to track the contents of node_modules directory, because:



                  • running npm install will wipe your your changes

                  • hundreds or thousand files are likely to end up present in that directory

                  • tracking package.json and package-lock.json in git is sufficient, then populate node_modules using npm install command.

                  You are not supposed to modify files located in node_modules directory directly. Instead, fork the module in question, modify it, and:



                  • either publish your own version in npm

                  • or reference it as a git repository inside package.json (how-to)

                  Then, also add node_modules directory to the .gitignore file.






                  share|improve this answer
























                    up vote
                    0
                    down vote













                    Adding the file to track



                    This is most likely not a suitable approach (read below). However , if you really want to do it:



                    In order to track a file nested under node_modules, you should add the directory. All of its content will be staged in git



                    git add node_modules


                    Recommended approach



                    You probably don't want to track the contents of node_modules directory, because:



                    • running npm install will wipe your your changes

                    • hundreds or thousand files are likely to end up present in that directory

                    • tracking package.json and package-lock.json in git is sufficient, then populate node_modules using npm install command.

                    You are not supposed to modify files located in node_modules directory directly. Instead, fork the module in question, modify it, and:



                    • either publish your own version in npm

                    • or reference it as a git repository inside package.json (how-to)

                    Then, also add node_modules directory to the .gitignore file.






                    share|improve this answer






















                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      Adding the file to track



                      This is most likely not a suitable approach (read below). However , if you really want to do it:



                      In order to track a file nested under node_modules, you should add the directory. All of its content will be staged in git



                      git add node_modules


                      Recommended approach



                      You probably don't want to track the contents of node_modules directory, because:



                      • running npm install will wipe your your changes

                      • hundreds or thousand files are likely to end up present in that directory

                      • tracking package.json and package-lock.json in git is sufficient, then populate node_modules using npm install command.

                      You are not supposed to modify files located in node_modules directory directly. Instead, fork the module in question, modify it, and:



                      • either publish your own version in npm

                      • or reference it as a git repository inside package.json (how-to)

                      Then, also add node_modules directory to the .gitignore file.






                      share|improve this answer












                      Adding the file to track



                      This is most likely not a suitable approach (read below). However , if you really want to do it:



                      In order to track a file nested under node_modules, you should add the directory. All of its content will be staged in git



                      git add node_modules


                      Recommended approach



                      You probably don't want to track the contents of node_modules directory, because:



                      • running npm install will wipe your your changes

                      • hundreds or thousand files are likely to end up present in that directory

                      • tracking package.json and package-lock.json in git is sufficient, then populate node_modules using npm install command.

                      You are not supposed to modify files located in node_modules directory directly. Instead, fork the module in question, modify it, and:



                      • either publish your own version in npm

                      • or reference it as a git repository inside package.json (how-to)

                      Then, also add node_modules directory to the .gitignore file.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 11 at 15:57









                      Mehdi

                      3,29711833




                      3,29711833




















                          up vote
                          0
                          down vote













                          If the whole directory is untracked, git status will show only the directory. Because it's untracked, there is no meaningful difference to git between changed and unchanged files in there.



                          Other answers have already addressed that tracking node_modules is nota good idea. Of you want to track your changes to modules, consider cloning the module repo and including it as a git submodule.






                          share|improve this answer
























                            up vote
                            0
                            down vote













                            If the whole directory is untracked, git status will show only the directory. Because it's untracked, there is no meaningful difference to git between changed and unchanged files in there.



                            Other answers have already addressed that tracking node_modules is nota good idea. Of you want to track your changes to modules, consider cloning the module repo and including it as a git submodule.






                            share|improve this answer






















                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              If the whole directory is untracked, git status will show only the directory. Because it's untracked, there is no meaningful difference to git between changed and unchanged files in there.



                              Other answers have already addressed that tracking node_modules is nota good idea. Of you want to track your changes to modules, consider cloning the module repo and including it as a git submodule.






                              share|improve this answer












                              If the whole directory is untracked, git status will show only the directory. Because it's untracked, there is no meaningful difference to git between changed and unchanged files in there.



                              Other answers have already addressed that tracking node_modules is nota good idea. Of you want to track your changes to modules, consider cloning the module repo and including it as a git submodule.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Nov 11 at 16:09









                              ohlec

                              1,710717




                              1,710717




















                                  up vote
                                  0
                                  down vote













                                  It should be inside .gitignore file. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.






                                  share|improve this answer
























                                    up vote
                                    0
                                    down vote













                                    It should be inside .gitignore file. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.






                                    share|improve this answer






















                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      It should be inside .gitignore file. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.






                                      share|improve this answer












                                      It should be inside .gitignore file. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Nov 12 at 13:17









                                      Jithin Babu

                                      215




                                      215



























                                          draft saved

                                          draft discarded
















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250383%2fgit-status-is-not-showing-my-changed-files%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Top Tejano songwriter Luis Silva dead of heart attack at 64

                                          ReactJS Fetched API data displays live - need Data displayed static

                                          政党