Fixed: Issues with Git not recognising changes in part of an app

git

#1

I wonder have any of the regular Git users on the forum seen something like this before. I've built out an API along the lines of the recent MEAN Stack: Build an App with Angular 2+ and the Angular CLI article, and have then created a VueJS app within the same root folder at vue_src/ much in the same fashion as the article author has done (he used Angular 2+, but it shouldn't matter).

What I'm having trouble with though, is that Git is not appearing to recognise changes in vue_src/, but does in the parent directory where git init was run from. VSCode is flagging up uncommitted changes though, but seems unable to use it's built in Git integration to do anything about it.

I've gone through the .gitignore file at the root and can't see anything that would cause this, though I do see that there is another .gitignore inside the vue_src/ directory - could that cause issue?

Edit: vue_src/ contains a .gitignore file, but no .git file in case anyone was wondering.


#2

What is inside your .gitignore? (the actual contents)

What happens when you run git status


#3

The current git status is on the screenshot above - it's clean, no changes. Unfortunately, I know categorically that's not true.

The root .gitignore contains this...

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

#Mac OS files
.DS_Store

and the vue_src/ .gitignore has this in it...

.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

#4

Seems I've lost something along the way. I just ran this command...

git submodule status

and got...

fatal: no submodule mapping found in .gitmodules for path 'vue_src'

I just checked in the parent folder .git folder and sure enough, there's no reference to a submodule in the config file. Next to make sense of this page - git-submodule

Edit: It would also be accurate to say that I can't find a .gitmodules file anywhere either.


#5

I got there in the end. Running the following cleared things up and got things back on track.

git rm --cached vue_src

That gave me a confirmation message on the rm, following which, running gst showed that I had untracked folder/files, from which point, I was able to stage and commit things again.

I found what I needed on this SO question - No submodule mapping found in .gitmodules for path


closed #6

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.