git status is not showing my changed files
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
add a comment |
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
I really don't understand the question...
– OznOg
Nov 11 at 15:49
add a comment |
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
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
node.js git github node-modules
edited Nov 11 at 20:00
Adam Liss
40.5k1193130
40.5k1193130
asked Nov 11 at 15:45
Chirayu Chirayu
226
226
I really don't understand the question...
– OznOg
Nov 11 at 15:49
add a comment |
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
add a comment |
5 Answers
5
active
oldest
votes
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.
1
... But the asker does see it in git status so it obviously is not ignored.
– OhleC
Nov 11 at 16:10
add a comment |
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.
add a comment |
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 changes - hundreds or thousand files are likely to end up present in that directory
- tracking
package.json
andpackage-lock.json
in git is sufficient, then populate node_modules usingnpm 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.
add a comment |
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.
add a comment |
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.
add a comment |
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',
autoActivateHeartbeat: false,
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
1
... But the asker does see it in git status so it obviously is not ignored.
– OhleC
Nov 11 at 16:10
add a comment |
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.
1
... But the asker does see it in git status so it obviously is not ignored.
– OhleC
Nov 11 at 16:10
add a comment |
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.
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.
answered Nov 11 at 15:53
dresh
304814
304814
1
... But the asker does see it in git status so it obviously is not ignored.
– OhleC
Nov 11 at 16:10
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 11 at 15:54
Stony
19.9k135164
19.9k135164
add a comment |
add a comment |
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 changes - hundreds or thousand files are likely to end up present in that directory
- tracking
package.json
andpackage-lock.json
in git is sufficient, then populate node_modules usingnpm 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.
add a comment |
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 changes - hundreds or thousand files are likely to end up present in that directory
- tracking
package.json
andpackage-lock.json
in git is sufficient, then populate node_modules usingnpm 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.
add a comment |
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 changes - hundreds or thousand files are likely to end up present in that directory
- tracking
package.json
andpackage-lock.json
in git is sufficient, then populate node_modules usingnpm 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.
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 changes - hundreds or thousand files are likely to end up present in that directory
- tracking
package.json
andpackage-lock.json
in git is sufficient, then populate node_modules usingnpm 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.
edited Dec 11 at 15:58
answered Nov 11 at 15:57
Mehdi
3,31711833
3,31711833
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 11 at 16:09
OhleC
1,732717
1,732717
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 12 at 13:17
Jithin Babu
215
215
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
I really don't understand the question...
– OznOg
Nov 11 at 15:49