6

Everytime I do git status there is this folder that appears as untracked.

$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       src/error/
nothing added to commit but untracked files present (use "git add" to track)

Even after doing git add ., git commit -a the folder at src/error keeps showing up as untracked. Other unstaged files get commited everytime only this folder keeps giving problems. Also git doesnt report any errors. What could be the problem here ?

tanascius
  • 53,078
  • 22
  • 114
  • 136
slayerIQ
  • 1,488
  • 2
  • 13
  • 25
  • 2
    Have you tried `git add src/error/` ? – strager Aug 10 '10 at 07:38
  • I tried that it didnt work i have a file in that folder i also tried adding that file directly didn't work also. – slayerIQ Aug 10 '10 at 07:42
  • Did you try to add a specific file under src/error ? What do you have in your .gitignore file ? – David Aug 10 '10 at 07:55
  • 1
    Can you show us the command you run and it's output? Also the contents of your .gitignore file would be helpful. Best guess: try using the '-f' flag with git add. – Greg Sexton Aug 10 '10 at 08:01
  • For this project i am not using the exclude or .gitignore files. I ran $ git add . -f -v i did not get any output. Then i did git status and i got the same output as in the first message telling me that the folder is untracked. – slayerIQ Aug 10 '10 at 08:19
  • @slayerIQ: Consider answering @strager, @Greg Sexton – mathk Aug 10 '10 at 09:40
  • there isn't a git repo or something in that folder is there? what's in the folder? – xenoterracide Aug 10 '10 at 16:43
  • @xenoterracide: The fact that git status lists it indicates that there are things that git thinks it should be able to add. @slayerIQ: Why are you running `git commit -a` immediately? Can you show us the output of `git add src/error` and then the output of `git status`, if changed, and the same for `git add -f src/error` (note that those options should be before, not after, the path) – Cascabel Aug 10 '10 at 20:18

3 Answers3

6

I found the problem and the solution this is what happened:

First src/error was called src/Error when i changed the case locally the foldername was changed but in git it was still commited as src/Error. Windows is case-insensitive so what i did was remove the folder commit and add it again with the right casing.

slayerIQ
  • 1,488
  • 2
  • 13
  • 25
1

Is that the folder empty if so it is normal, see here

Community
  • 1
  • 1
mathk
  • 7,973
  • 6
  • 45
  • 74
1

I've tried the following in a Windows 7 console and it worked, i.e. it did not show \src\error\ as untracked.

C:\t>dir
 Volume in drive C is BLAH
 Volume Serial Number is 2ECA-CB88

 Directory of C:\t

10.08.2010  17:56    <DIR>          .
10.08.2010  17:56    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  59'844'902'912 bytes free

C:\t>mkdir .\src\error

C:\t>copy con: .\src\error\text.txt
blah^Z
        1 file(s) copied.

C:\t>git init
Initialized empty Git repository in C:/t/.git/

C:\t>git add .\src\error\*

C:\t>git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   src/error/text.txt
#

This doesn't answer your question, but I thought it might help to see a full step-by-step example.

Lernkurve
  • 20,203
  • 28
  • 86
  • 118