开发者

git still untracked after add

开发者 https://www.devze.com 2023-01-11 09:16 出处:网络
Everytime I do git status there is this 开发者_如何转开发folder that appears as untracked. $ git status

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 ?


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消