Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't Git tracking changes in a subdirectory?

Tags:

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 GitHub in first commit, saved it and git status says there's no changes.

Ok, I think, must have messed something up, git reset --hard HEAD, and as I understand that should revert everything, but my file is not reverted.

So I think I'm doing something wrong. I edit file in root folder, git status- shows there are changes, works as suspected, so it works on files in root folder, but not in sub folders.

Am I missing something obvious here?

UPDATE: Evidence, that file I'm editing was really commited (git log --stat):

enter image description here

if it helps, tree picture:

enter image description here

UPDATE2: Ok, I thought I really messed something up, so I've deleted folder, where was my solution, cloned once again from gitHub, and my local code still differs from existing in gitHub and git status sees no changes, git log origin/master..HEAD gives nothing.

like image 771
Giedrius Avatar asked Jan 27 '12 14:01

Giedrius


1 Answers

Sometimes I have the same problem, especially when I have subfolder which is another git repo itself. The solution is: renaming the folders. Try switching the folder name to something else. Commit that, then rename it back. If the subfolder itself is another Git repo, and you want it to be totally detached from the mainstream, and follow your repo, you should remove the remote of that subfolder first.

like image 93
Timothy Quang Phuc Nguyen Avatar answered Sep 21 '22 01:09

Timothy Quang Phuc Nguyen