This is my first commit in git. I got the following response :
*$ git commit -m "Initial commit 2"
[master 741933b] Initial commit 2
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 new.html*
Is the commit performed successfully?
Getting started with Git can be daunting, especially if you're not used to the command line. A few heuristics can help:
echo $?
as the immediately next command to see the exit code of the previous command. If it prints anything other than "0" the command very likely failed (some commands use non-zero exit codes to signal various non-error situations).In this specific case you can use git status
to show you the current status of the repository. You can tell that the commit was successful by the fact that there should be no "Changes to be committed" section in the output.