I had some issues about pushing a local git repo to an existing remote git repo (Github). Git was complaining about a folder that was missing in my local repository but present in my remote repository, so I wasn't able to push on Github. As I had no idea about how to solve this problem I decided to delete both git repositories (local and remote) -- using How to fully delete a git repository created with init? --, and create a new repository in my project directory to push it on Github.
Then I did git init
and git add .
and got this message in VS Code :
"The git repository at /path
has too many active changes, only a subset of Git features will be enabled. Would you like to add 'node_modules' to .gitignore?" -- I did nothing about that.
Then when I enter git status
in Terminal I had an unusual / huge amount of files (node_modules again) on stage except my src/pages folder which is displayed in red:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: src/pages (modified content, untracked content)"
So I did git add src/pages
and after that I got back to the same problem.
Git also proposed me to use git rm --cached <file>
to unstage but I don't know what that does once executed (I mean it doesn't work in my case).
It seems I created a kind of conflict by deleting and recreating my local git repository and I'm unable to figure out how to get things back to normal. I would like to be able to track the content of the src/pages of my App again and then push it on Github. Could anyone explain me what is happening under the hood? Thanks.
Note: I also tried this but it doesn't work for me : How to fix "modified content, untracked content" in git?