The Internet
The Internet

Reputation: 8123

Folder not showing on github, but is present in git

I have a project where a non-empty folder is displaying on my local file system, but is not present in github. It did not always used to be like this. I am not ignoring this folder. I know that git doesn't let you add empty folders. What could possibly be the problem? I tried re-adding it but its acting as if it were ignored. What can I do to troubleshoot?

Upvotes: 1

Views: 4706

Answers (1)

Chris
Chris

Reputation: 137178

When trying to figure out why something is ignored, it is often useful to use the git check-ignore command:

$ git check-ignore --verbose some/file.txt
.gitignore:1:some   some/file.txt

The output can be interpreted like so:

If --verbose is specified, the output is a series of lines of the form:

<source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>

<pathname> is the path of a file being queried, <pattern> is the matching pattern, <source> is the pattern’s source file, and <linenum> is the line number of the pattern within that source. If the pattern contained a ! prefix or / suffix, it will be preserved in the output. <source> will be an absolute path when referring to the file configured by core.excludesfile, or relative to the repository root when referring to .git/info/exclude or a per-directory exclude file.

Upvotes: 5

Related Questions