Git Commit

We’ve now put some work into our code so we should save our work. We’ll commit our work back to the repository we forked at the beginning of the workshop.

  1. Add your work to your repository and commit

Open a terminal window or open the VSCode integrated terminal. You’ll first add your modified files, and commit the work locally.

git add .
git commit -m "added hello and new talk routes"

In the git add . command above, the . means all the files in the current directory will be added. There might be times where we only want to add particular files to our commit, and in that case we can replace the . with one or more filenames (separated by spaces). You can see which files have been added to a commit by using git status

  1. Push to GitHub.

Now push your code to GitHub:

git push -u origin main
  1. Visit your repository on GitHub to confirm you pushed your code.