1

So I'm trying to make my life easier and use the command line to do a git add . and then do a git commit -m which works when I'm in the folder that houses the file. But when I'm above it in the master folder which houses all of the files it says something like this

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:   wp-content/themes/FoundationPress (modified content)"

I can go in and then add the file and then cd all the way up to the top of the folder and add it, but I would like to be able to add everything in one go from the top folder.

Does anyone know what I'm doing wrong and how to fix this issue?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Branduo
  • 186
  • 2
  • 12

1 Answers1

1
(modified content)

That is because wp-content/themes/FoundationPress is a gitlink, that is: special entry in the index of the parent repo.

It indicated that the submodule wp-content/themes/FoundationPress has changed, meaning its tree SHA1 has changed.
You can list that SHA1 with:

git rev-parse @:./wp-content/themes/FoundationPress

You need to add and commit that new SHA1 in order for anyone cloning your repo to be able to checkout the submodule at the right state.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm sure this is right but could you dumb this down for me a little bit more? – Branduo Jul 07 '17 at 15:05
  • @Branduo Sure; let's start with: https://stackoverflow.com/a/1979194/6309 – VonC Jul 07 '17 at 15:41
  • I guess this still isn't making much sense to me :( – Branduo Jul 10 '17 at 18:52
  • @Branduo Sure, what are your questions about the notion of submodule and gitlink? – VonC Jul 10 '17 at 18:55
  • Ok so basically I get the fact that it's a submodule, I want it not to be a submodule and I want to see all the files in my github repository (right now I can't expand the folder that contains the FoundationPress files). It's two gray folders instead of a regular looking folder in github. How do I make it so that I have access to all those files. – Branduo Jul 10 '17 at 19:00
  • @Branduo no problem: https://stackoverflow.com/a/26752628/6309 (that won't keep the history of those files though) – VonC Jul 10 '17 at 19:10