Git Assessment/ switch from subdirectory before changes?

I’m having an issue with my Git Assessment. You see I’m at the portion where it’s telling me to “commit all these changes to the pictures branch” However, when I tried to commit it gave me the following error:

arcapalbo@Dcap2:/mnt/c/Users/ARCap/Downloads/git-repo-management/images$ git 
status
On branch pictures
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git restore <file>..." to discard changes in working directory)
        modified:   ../site.html

no changes added to commit (use "git add" and/or "git commit -a")

Because of this I’m rather confused. Am I supposed to switch from the ‘images’ subdirectory back to the ‘git-repo-management’ directory before I stage my changes? Or is there something that I’m not doing correctly? If someone could please help I would be very appreciative.

Hi Alice,
I was having the same issue and kept getting error messages after practicing the assessment (at least 6x) before realizing that yes, you have to go ‘up’ to get out of the ‘images’ subdirectory in order to commit the changes; ‘images’ is too specific/narrow for the changes to commit properly, otherwise it wont apply to the entire branch…Basically each time we have to ‘add/save/commit’ all changes, we have to go to /git-repo-management

2 Likes

Thank you so much, I have tried about 6 times as well.

While you’re here, maybe I can get some feedback from you. In the portion where we have to put the image tags in the site.html folder, the instructions have ‘joseph-roulin.jpg’ entered as the last tag, however the output file structure has it first. Did you type it in as instructed and it alphabetized it for you? I self-corrected and typed it first in my code, but I got that submission back with it as the ‘diff’ or error

I just manually added by copying the path from visual studio code and adding it that way. Do you think that will count against me since I had to add twice? all changes were committed, but I had to use git add . twice instead of once

I just typed it in as instructed.