Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verbose display of a git add

Tags:

git

debugging

add

I have a file that shows up in git status's "Changed but not updated" list as (modified content, untracked content), and whose status doesn't change when I do git add on it.

I was wondering if there is a command that will give me more diagnostic information. The -v option didn't to anything.

like image 552
dysbulic Avatar asked Mar 16 '11 04:03

dysbulic


2 Answers

Make sure your file isn't part of a submodule: adding a file of a submodule from its parent repo wouldn't work.

git status can display changes to a submdodule, unless the --ignore-submodules[=<when>] is used. (or if the config diff.ignoreSubmodules is set).

like image 113
VonC Avatar answered Sep 21 '22 23:09

VonC


Check the response of git ls-files --others --ignored --exclude-standard to see if Git believes it should be ignored. This would be the first debugging step that I would take.

Then, you can try to force the addition with git add --force <filename> and see if that overcomes any ignoring that is preventing the addition to staging.

like image 22
Matthew McCullough Avatar answered Sep 23 '22 23:09

Matthew McCullough