Why isn't Git tracking changes in a subdirectory?

后端 未结 8 1000
萌比男神i
萌比男神i 2020-12-15 07:52

I\'ve created git repository, added code and pushed it to GitHub.

Then locally, I\'ve edited the file Eila.Analyser/Program.cs, that was added to GitHu

相关标签:
8条回答
  • 2020-12-15 08:23

    I had the same issue but realised my issue was the ignore at top level. I ignored the .php files so anything that was of .php could not be changed

    0 讨论(0)
  • 2020-12-15 08:26

    PROBELM (In my case)
    Performing a git checkout -b <branch_name> had no effect and my folder and files in that branch were still not visible locally, though they are on our gitlab server.

    SOLUTION
    Copied the SHA hash of last commit in that branch, then locally:

    git checkout -b <branch_name> #SHA Hash

    Now I see the expected sub-directories and files.

    0 讨论(0)
  • 2020-12-15 08:29

    For me the solution was

    Renaming the untracked folder

    0 讨论(0)
  • 2020-12-15 08:29

    My case was exactly what Timothy mentioned. I had a subfolder that was also a git repo. I removed the git from the subfolder but the 'parent git' stopped tracking it. Renaming the folder via windows explorer didn't fix the issue but renaming it through git did the job. So, I did '$ git mv folder-name folder-name-temp'.. than renamed back to its original name :)

    0 讨论(0)
  • 2020-12-15 08:30

    For me, the problem was that I had a filename in my .gitignore file which did not exist. Removing this invalid filename from .gitignore solved the problem. Also, I deleted all the .gitignore files from subdirectories and only kept the top-level .gitignore file.

    0 讨论(0)
  • 2020-12-15 08:36

    Try running git update-index --really-refresh.

    I did have similar problems on Windows and that solves it.

    You should also check the core.ignoreStat option with git config.

    0 讨论(0)
提交回复
热议问题