According to the question you’ve created a repository and created files in the index but you didn’t stage the file for that:
git add <file-name>
git add . //for adding all files
Then commit the files using:
git commit -m”initial commit”
Then your files will be saved to the local system and the error is resolved.
For better understanding about these git commands go through the following crash course on git that will help you to understand git well
You can also read the Git Tutorial and enroll for Git Training to learn in-depth about git.