I can't commit after pushing repo to github. What i'm basically trying to do is to clone some code from one github repository, do some changes and push the code to another github repository. I make some local repo, cloned the code, pushed the code to another GH remote repository and it all worked out fine, now when i'm making some changes on my local repo and i'm trying to 'add .' then 'commit -m' i'm getting this message.
EDIT:
After 'git add -A':
Any thoughts?
CodePudding user response:
You have a submodule.
Specifically, your output includes the following (which I had to retype, so this might have typos—try not to use screenshots if plain-text will do; this avoids manual-copy-paste errors):
Changes not staged for commit: ... modified: FakeApiReqresTest (modified content)
The parenthetical phrase (modified content)
is what tells us that FakeApiReqresTest
is not a file.
The submodule in question is another Git repository. This other Git repository has a modified working tree, i.e., what's in its working tree is not committed yet. The superproject repository can only record the hash ID of one specific commit in the submodule Git repository per superproject commit. The git add
command, run in the superproject, will put the correct commit hash ID into the superproject Git index / staging-area, based on the commit that is currently checked out within the submodule. (Is that confusing? It is to me