Making a commit in Heroku

The next step in the process will be to make the commit and then we can finally start getting it up on the Web. From the Terminal, we'll use some of the Git commands we explored earlier in this chapter. First up, git status. When we run git status, we have something a little new:

Instead of new files, we have modified files here as shown in the code output here. We have a modified package.json file and we have a modified server.js file. These are not going to be committed if we were to run a git commit just yet; we still have to use git add. What we'll do is run git add with the dot as the next argument. Dot is going to add every single thing showing up and get status to the next commit.

Now I only recommend using the syntax of everything you have listed in the Changes not staged for commit header. These are the things you actually want to commit, and in our case, that is indeed what we want. If I run git add and then a rerun git status, we can now see what is going to be committed next, under the Changes to be committed header:

Here we have our package.json file and the server.js file. Now we can go ahead and make that commit.

I'll run a git commit command with the m flag so we can specify our message, and a good message for this commit would be something like Setup start script and heroku port:

git commit -m 'Setup start script and heroku port'

Now we can go ahead and run that command, which will make the commit.

Now we can go ahead and push that up to GitHub using the git push command, and we can leave off the origin remote because the origin is the default remote. I'll go ahead and run the following command:

git push

This will push it up to GitHub, and now we are ready to actually create the app, push our code up, and view it over in the browser: