When you git commit, git calls the nano editor for you to edit the commit message. But you haven't finished editing, so git commit is waiting for you.
In the nano editor, when the editing is completed, please save and exit (press Ctrl-X according to the prompts and then select save as prompted). You press Ctrl-Z, which means "suspend" nano - that is, tell it that you have something to do now and don't want to deal with it for the time being. Use the fg command to go back and continue the operation.
The command submitted to the local area is written incorrectly
It should be like this
git add
只是把代码添加到暂存区,git commit
才是把代码提交到版本库,你使用git commit
的方法错了,并没有把你的代码提交到版本库,你只需要按照 @东方星痕 和 @xiaocui 的方法commit
到版本库后再git push
That’s it.How to upload code to github. You can refer to this article on how to use Git to upload project code to github
Commit usage:
git commit -m 'Commit information'
@东星狠 and @xiaocui should be right. I would also like to add that before submitting, you can
Check the status. If no file is listed, it means it has been submitted.
When you git commit, git calls the nano editor for you to edit the commit message. But you haven't finished editing, so git commit is waiting for you.
In the nano editor, when the editing is completed, please save and exit (press Ctrl-X according to the prompts and then select save as prompted). You press Ctrl-Z, which means "suspend" nano - that is, tell it that you have something to do now and don't want to deal with it for the time being. Use the fg command to go back and continue the operation.