0

I've searched my box. I have no global or local .gitignore file. the dir's and files are not in in .git/info/excludes

but if I git status --ignored my dir's are listed there. Even if I change the dir names they are still in the list of ignored items.

Any ideas would be handy

edit

# On branch master
# Initial commit.
#
# Ignored files:
#   (use "git add -f <file>..." to include in what will be committed)
#
#       dir1/
#       dir2/
nothing to commit (create/copy files and use "git add" to track)

yes there are files and folders in dir 1 and 2

I tried git check-ignore dir1 No output was returned

Community
  • 1
  • 1
H30
  • 134
  • 2
  • 12
  • Can you provide output of the `git status --ignored` command? – zigarn Sep 07 '17 at 09:43
  • Try `git check-ignore ` to see why `dir` is ignored. – ElpieKay Sep 07 '17 at 09:45
  • 3
    Are there files in the directories? Git won't care about (empty) directories. See [here](https://stackoverflow.com/questions/3030230/does-git-ignore-empty-folders). – kowsky Sep 07 '17 at 09:55
  • see question edit – H30 Sep 07 '17 at 10:05
  • 1
    What files are inside `dir1/` and `dir2/`? Try running `check-ignore` on them. – Nils Werner Sep 07 '17 at 10:12
  • You need to `git add` the files you want to commit, it even says so on the message you posted... – m0skit0 Sep 07 '17 at 10:13
  • Well thank you @m0skit0 but I have already done that. confused as I am that it is ignoring said files I do understand how to use git. – H30 Sep 07 '17 at 10:27
  • most are .txt config files @NilsWerner – H30 Sep 07 '17 at 10:29
  • also no output on them from the git check – H30 Sep 07 '17 at 10:29
  • Point `check-ignore` at a _file_ inside one of those directories, not the directory itself. I would also add `-v` for good measure: `git check-ignore -v dir1/file1`. I wonder if you've got them ignored in `.git/info/exclude`? – ChrisGPT was on strike Sep 07 '17 at 11:58
  • 1
    It's also possible that those directories include their own `.git/` directory (that is, you've got a Git repository inside a Git repository). By design, Git doesn't track nested repositories. You'll have to use submodules, subtrees, or something similar if you want to nest repositories. Try `ls -A dir1/` to see if it contains a `.git/` directory. – ChrisGPT was on strike Sep 07 '17 at 11:59
  • Hi Chris, yea the .git in the folders were my first thought. I did a check to confirm again anyway and no ```.git``` are anywhere besides the main repo. I checked the ```.git/info/excludes``` first as that's what I assumed the issue was, but it was untouched. I have also tried looking at the ```git check-ignore -v dir1/file1``` no output. I've also looked for a global ignore file or a profile related one and cant find anything. I may have to delete the repo and try again. – H30 Sep 07 '17 at 14:40
  • @H30, is anything funny happening at the filesystem level, e.g. `dir1`/ and `dir2/` might live on different partitions but be mounted to these locations? – ChrisGPT was on strike Sep 07 '17 at 17:33
  • No they are all on the same area. all created there and no separate partitions for this drive. – H30 Sep 08 '17 at 08:55

1 Answers1

0

So I still have no idea what was wrong or what the issue was but I did a git clean and it seems to have sorted the issue. Thank you all for your suggestions and input.

H30
  • 134
  • 2
  • 12