{"thread":{"id":"50229","subject":"'git add .' failing to stage files in OS X","startedAt":"2019-01-15T14:07:01Z","lastAt":"2019-01-15T14:07:01Z","messageCount":1,"participants":["Lewis Cawthorne"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"366712","messageId":"CABvi_gsnpyeJAxJr3xyi6XC1byTsbbFU3EKnJhJmem7vJ-OHtA@mail.gmail.com","threadId":"50229","inReplyTo":null,"subject":"'git add .' failing to stage files in OS X","fromName":"Lewis Cawthorne","fromEmail":"llcawthorne@gmail.com","sentAt":"2019-01-15T14:06:45Z","receivedAt":"2019-01-15T14:07:01Z","isPatch":false,"sender":{"key":"llcawthorne@gmail.com","avatar":null},"body":"I'm having a problem on my MacBook.  When I do `git add .` and then do\n`git status`, all my files in the current directory and subdirectory\nremain untracked.  I'm not sure if it's a bug in the OS X version of\ngit I'm using (I tried upgrading) or something specific to the setup\non my Mac (I've tried eliminating possibilities).\n\nThe problem started with a directory I had named 'micronaut-guides'\nthat I wanted to initialize as a repo.  It had a subdirectory called\napprentice and one called data-access.  apprentice has a subfolder\nnamed 'java' with five or six subfolders containing java projects, and\ndata-access had one folder 'jpa' containing a java application.  If I\ncd to micronaut-guides, then `git init`, then `git add .` and then\n`git status`, I get the following:\n\n-----------------\nOn branch master\n\nInitial commit\n\nUntracked files:\n    .gitignore\n    README.md\n    apprentice/\n    data-access/\n\nnothing added to commit but untracked files present\n-----------------\n\nIf I try to track a specific file in a subdirectory (`git add\napprentice/java/commit-info/Dockerfile`), it successfully stages the\nsingle file, and then lists other files in the\napprentice/java/commit-info directory as specifically untracked,\nrather than just listing the directory as untracked.  I can\nsuccessfully stage a single file in the root directory of the\nrepository by doing `git add .gitignore`, and then when I do `git\nstatus` the .gitignore file shows as staged and the other files remain\nuntracked.\n\nI've since verified the command-line client is exhibiting the same\nbehavior in other repos cloned from github when I try to add content.\nI cloned my spring-guides repository from github and created a\ndirectory for the actuator-service guide, worked through the tutorial\nto create a functioning project in the subdirectory, then did `git add\n.` and `git status` and it said the new folder was untracked still.\n\nI've found a work around.  Instead of using the command-line client, I\nhave to open the Github Desktop client, and then add my files and sync\nto get changes up to my repo.  Everything works fine adding files and\npushing changes there.\n\nSo far, I've tried adding files in both a new and existing repository.\nI've tried `git add -A` instead of  `git add .`.  I've tried `git add\n--all ./` with no luck.  It has been doing the same thing for both the\nApple version of git I started with, and the 2.20.1 version that I\nupgraded to (installed via homebrew).  I've also tried deleting my\n.gitignore file, even though the same .gitignore works with repos on\nWindows fine.  I made sure there was no .gitignore in any parent\ndirectories and that there were no .git folders in any parent\ndirectories.  `git check-ignore -v -- /path/to/a/file` didn't produce\nany output.  I've also tried changing my shell to bash instead of zsh,\nin case something in my shell was interfering.  I've checked my\naliases to make sure I'm not aliasing git to some other command.  And\nI've tried moving the repo directory to / and adding files there, to\nbe extra sure nothing in any parent directory was interfering with the\noperation.\n\nAs I recall, git used to work fine on this Mac, but it's been a while\nsince I've tried to use it (it being both the Mac and git on the Mac).\nThe Mac in question was recently upgraded to OS X Mojave (it bugged me\nto upgrade when I dusted it off and turned it on).  I don't remember\nwhen the last time I used git on it for anything before the upgrade\nwas..\n\nI've asked about this in StackOverflow, so there are a little bit more\ndetails and ideas from other people at\nhttps://stackoverflow.com/questions/54175235/cant-git-add-to-stage-files-in-new-repo,\nbut I tried to summarize everything here.\n\nAny ideas to fix this or even work around this without using a GUI\nclient would be appreciated.\n\nThanks,\n\nLewis Cawthorne\n"}]}