Development Tools Introduction to Git First Commits Staging Changed Files

Thea Partin
Thea Partin
5,879 Points

Hi, the teacher said we add things to the metal.html file then click in the console to activate it and I clicked down

<!DOCTYPE html> <html> <body> <p>We have a fine selection of medals.</p> <div> <a href="bronze.html">Bronze medals</a> </div> </body> </html>

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 88,477 Points

I'm not entirely sure which bit of the video this is referring to but I think you're trying to enquire as to how to add changes to the "staging area" of Git. So that Git knows which changes to commit or "save".

Say that you're medals.html. You make and save some changes in the file. You then want to make sure you're in the directory for that file. You do that in the console.

Then type in "git status" in the console to make sure that the medals file shows up in the staging area as. That means it is ready to be added and commit.

Type in git add metals.html or git add . in the console.

Try git status again.

If the file shows up as green you have added your changes in git correctly.

I hope that has helped you add to your understanding for how to use Git in your coding. :)