GIT Add

So just creating a new file inside of your repository directory isn’t enough to register the file with GIT. First you need to “add” it.

How do we do that?

I’ll give an example. I am making a repository of our website. I go to a page and save the page as a complete web page in my repository.

Now from the command line I type “git status” and see this:

Now I can use “git add package.html” to add the html page, I follow that with git status:

Wahoo! Now packages.html is “staged” for a commit. I’ll talk about this in git commit.

Next I do “git add package_files/” and we see this:

Excellent! Now we are ready to do git commit to commit the changes to GIT.

Related pages