Update git before deploy?

I am at the point in Chapter Five where I am ready to deploy. Do I need to do the git adds and git commit for the changes I have made before deploying? Below is what I get from git status:
On branch master
Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

deleted:    Sources/App/Controllers/TodoController.swift
deleted:    Sources/App/Models/Todo.swift
modified:   Sources/App/configure.swift
modified:   Sources/App/routes.swift

Untracked files:
(use “git add …” to include in what will be committed)

Sources/App/Models/Acronym.swift

no changes added to commit (use “git add” and/or “git commit -a”)

@chriscrossen Thanks very much for your question!

Committing your changes to Git should have no bearing on the deployment of your project, regardless of whether it is iOS, .NET, Java, or otherwise. Git simply allows you to store your changes and allow other developers to use your code. When your launch your iOS project, you are launching from your machine, and not from your Git repository.

Having said that…

Yes, you should ensure that all of your changes, and updates are committed so that if anything should happen to your project, your changes are saved. It’s always good practice to commit changes regularly to ensure that individual commits are isolated from unrelated changes which allows you to track your changes better, and of course, ensure that your code repository is up to date.

I hope this helps!

All the best!

@chriscrossen @syedfa actually for Vapor Cloud, you do need to commit your changes to Git before you can deploy to Vapor Cloud. Since Vapor Cloud clones your project from the remote repository (GitHub), your changes must be committed and pushed before you can deploy.

In Chapter 5 the vapor cloud deploy command should commit your changes for you, but you can do it manually with

git add .
git commit -m "Add first project files"

And then setting up your remote repository

Thanks, Tim. I thought the deploy command might do a commit, but wanted to be sure. I’m enjoying the book and your video series. Thank you for your work.

Thanks very much for bringing this to my attention, and @chriscrossen I apologize for my error. This is a complete first for me!

No problem, @syedfa. Your advice would normally be right. This was just an unusual circumstance.