How to commit?

Im on 5 git reset with the hamlet and what not. Ive kinda lost track on how to use the commit command.


git add file name here (you can use a . to add everything to the staging area. Might not work in codecademy)

Then do:

git commit -m “message here”

and there you go :slight_smile:


What is the message? That’s what is really confusing me

If it’s not specifically set in the instructions you can put any message you like

Its on the Pete Pan question

I think you can just put any message you like.

Just give it a shot :slight_smile:

does it have o be in "?


git commit -m “peter pan changes”

alright,ill keep trying

The quotes are to tell bash (the program that you’re writing all your commands to) that the whole message is a single argument to the program, otherwise it would split on space.

Single quotes would also do the job, with the difference that all characters within the single quotes are interpreted as literal values i.e. no backslash escaping or using environment variables)

So you could enter just one word, completely unquoted.

The purpose of the message is to document what changes are made by the commit. The first line is meant to be short (50 chars or less) but more details can be added below (If more than just one line you’ll probably want to use a text editor, git will open up an editor (it’s possible to tell git which to use) if you do not include the -m option)


Worked fine! Thanks!

1 Like

A post was split to a new topic: I am doing the right git commit -m but it says my git is not valid