Lost
Lost

Reputation: 13585

This path skips through empty directories even though directory is not empty

I have two directories in my repo

  1. src
  2. tests

now, tests is actually a new directory(which is not empty). It does have a tests.csproj and related files into it.

Now, on my local everything looks good but when I push it to GitHub, couple of unexpected things start happening:

the tests folder shows up as

  1. Tests/projectFolder on github. Which has multiple things which are wrong. I was expecting to see just tests folder. I have no idea why it shows full path to the project folder.
  2. Suddenly the tests folder is capitalized without a reason, now sure why.
  3. When I hover over the folder it shows This path skips through empty directories message on github. Which could be a problem if it in fact was en empty folder but it really is not.
  4. when I include a .gitkeep file in the tests folder as suggested on this link: Does git ignore empty folders? then it sholves the problem that it shows the entire path of Tests/projectFolder instead of tests but as you can notice the capitalization issue is still there. And also the I just do not want to put a .gitkeep file in any of my folder if I do not have to. Which I think is a fair expectation if my folder is not empty.

I have multiple problems with it. First of all, I may have to go through this exercise(of adding (.gitkeep) file only if it was an empty folder. If it is not an empty folder then I should just be able to add a new folder and add new files in it and it should just show up on GitHub as it is. Also, I have no idea where is this involuntary capitalization is coming from. Any ideas?

Upvotes: 1

Views: 4842

Answers (1)

mhthies
mhthies

Reputation: 113

For your first question: The skipping through empty directories thing is just some eye-candy on the GitHub website. They want to take off the load of skipping through a deep tree of directories off you, if each directory has only one child directory. Instead, they show a quick link into the next directory which has more than a single child directory. However, in your Git repository, the directories are stored as you'd expect.

But, I can't figure out, where the capitilization comes from. Git should track your files and directories just as you named them—which includes the correct case. Did you double-check the directory's name on your local disk?

Upvotes: 2

Related Questions