How to commit?


#1

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


#2

so

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 :slightly_smiling:


#3

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


#4

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


#5

Its on the Pete Pan question


#6

I think you can just put any message you like.

Just give it a shot :slightly_smiling:


#7

does it have o be in "?


#8

Yes

git commit -m "peter pan changes"


#9

alright,ill keep trying
thanks


#10

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)


#11

Worked fine! Thanks!


#12

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


#13