Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Introduction to Git First Commits First Commits

Eduardo Osorio
.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
Jonathan Grieve
Treehouse Moderator 90,825 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. 🙂