Simon Suh Simon Suh - 2 months ago 24
Git Question

how do I complete a git commit?

I typed in 'git -commit' and got the following on my terminal

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
#
# Initial commit
#
# Changes to be committed:
# new file: index.html
# new file: index3.html
#
# Changes not staged for commit:
# modified: index.html
#
# Untracked files:
# index2.html
#


now I'm stuck on this screen and I don't know what to do to complete the commit and return back to the directory area of the terminal to continue with other tasks in the cmd. Help!

Answer

This is not related to git but with the text editor configured for use. In vim, you can press i to start entering text and save by pressing esc and :wq which would commit the message you entered.

In the above state, to quit without committing, you can do :q instead of the :wq as mentioned above.

Comments