Before commiting any changes you first should stage them. Imagine that you've made changes in multiple files but you want to commit changes only in 1 file. Then you stage this file and commit the changes you've made in it. Since you haven't staged anything, you're getting an error.