Development Tools Introduction to Git First Commits First Commits

Eduardo Osorio
seal-mask
.a{fill-rule:evenodd;}techdegree
Eduardo Osorio
Full Stack JavaScript Techdegree Student 15,476 Points

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?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 87,858 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. 🙂