2

I'm trying to add every single thing I have in directory through git. However, for one particular directory, it loads the folder, but none of the contents. I tried to use

git add -A

but was returned

# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   sendgrid-php (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")

upon trying to commit my changes. What could be the problem here?

user1114864
  • 1,734
  • 6
  • 26
  • 37
  • 2
    Maybe your .gitignore file is ignoring the folder or its content. – eLRuLL Feb 18 '13 at 00:45
  • possible duplicate of [git add -A is not adding all modified files in directories](http://stackoverflow.com/questions/7726131/git-add-a-is-not-adding-all-modified-files-in-directories) – nawfal Aug 07 '13 at 07:23

2 Answers2

1

One possible way would be

git add directory/*

or if you have already commited files from that directory before you can just make a

git commit -a

That will add and commit all modified files.

bssstudio
  • 174
  • 3
  • When using your first suggestion, I get 'fatal: Path 'sendgrid-php/MIT.LICENSE' is in submodule 'sendgrid-php'' – user1114864 Feb 18 '13 at 00:42
  • Do you have another git repo in the directory 'sendgrid-php'? The error message suggests that that directory is part of a git submodule (http://git-scm.com/book/en/Git-Tools-Submodules). – bssstudio Feb 18 '13 at 00:50
  • I think I may, but I'm not sure how to address it in terms of committing it. – user1114864 Feb 18 '13 at 02:20
1

Directory sendgrid-php is git submodule, so git will not track content inside it, unless you will CD into it and commit them.

MPogoda
  • 138
  • 1
  • 7
  • I tried to commit while in the subdirectory, I'm told I'm ahead by one commit, and that I have nothing to commit. – user1114864 Feb 18 '13 at 02:16
  • Have you staged changes in subdirectory (via git add -A) ? – MPogoda Feb 18 '13 at 02:18
  • Yeah, I do that and still get the # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean)' – user1114864 Feb 18 '13 at 02:19
  • CD back to your project directory, there shouldn't be any untracked content now. – MPogoda Feb 18 '13 at 02:20
  • I CD into the subdirectory, run 'git add .' , CD out into the project directory, try to commit, and get '# On branch master nothing to commit (working directory clean)' . This also happens when I run 'git add -A'. However, when I navigate to my domain, and then add '/send-grid.php', all it shows is a hyperlink to 'Parent_directory' – user1114864 Feb 18 '13 at 02:26
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/24678/discussion-between-user1114864-and-mpogoda) – user1114864 Feb 18 '13 at 02:28