If I modify a file that's in the staging area, do I have to stage it again before commiting?
I mean, lets say I just staged a file but before commiting I remember I missed something so I modify the file again. Do I need to stage again before commiting for the latest changes to be taken into account or can I just commit and the changes will be taken into account nonetheless.
Alson, in the video they explain the 3 different stages for files:
1) Modified 2) Staged 3) Commited
If a staged file is modified again before being commited, does it go back to the modified state, is it unstaged?
Jonathan GrieveTreehouse Moderator 89,652 Points
Yes, you’ll need to stage again with
git addafter you make any saved changes without committing.
If you’re ever unsure if you’ve staged anything, you can always check the stage of the staging area by running
git status at any time.
Any file showing up in green has been staged.
And any file showing up in red has not been staged and needs to be added with the command at the top of this post. 🙂