Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Git First Commits First Commits

Eduardo Osorio
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Eduardo Osorio
Full Stack JavaScript Techdegree Graduate 20,847 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 91,253 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. πŸ™‚