What has been described here is all perfectly OK, but what I prefer to do is to simply upload all files in question to the CS50 IDE, make sure that the directory structure matches what has been described in the assignment, and run the submit50 command you need to.
Hope this works! If it does, please consider upvoting this post.
Better not use -a, as you might accidentally stage files you did not want to stage.
From git help commit:
Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.