Reputation: 21
So I did the typical checkout -b mybranch remote/development
then I modified some existing files then I added a folder and some files in that folder
when it was time to commit the above changes/additions, i did a
git add newFolderName
git commit -m "blah" newFolderName
(note that I had not done an "add" or "commit" for the files in the new folder)
doing the above seemed to commit the new folder as well as (unexpectedly) the files in the new folder The commit was pushed ok, the pull request worked, and the code was reviewed and comments were tracke in BitBucket
After making a few mods after the code review I did a git status
It shows the new folder as being tracked, but git seems unware of the files in that folder doing a "cd" into that folder and then a "git status" shows that the files are "untracked"
So how are they untracked if they were successfully pushed???
Was my approach for adding the folder/files wrong?
Thanks!
Upvotes: 2
Views: 41
Reputation: 1326784
First, I always do a git status
before a commit: that way, I am aware of all the files (or the lack thereof) which are about to be committed.
As commented, adding a folder would add the (non-ignored) files by default.
It shows the new folder as being tracked, but git seems unware of the files in that folder
Beside a submodule (which would manifest in a separate .gitmodules
file in the parent repository), one possible explanation is a nested git repository (meaning a .git/
directory in your added subfolder). Make sure this is not the case.
Upvotes: 1