Get stuck at the last part!


#1



https://www.codecademy.com/courses/learn-git/lessons/git-backtracking/exercises/git-reset-1#


I'm stuck at this "From the terminal, make a commit to save the Larry/Laertes name swap in hamlet."


#2

The program that you need to run is git, you would tell git to commit by giving it certain arguments


#3

Hmm.. Now I tried this
$ git commit scene-2.txt
then I typed the combination
ctrl + o
hamlet
y

And I can't pass it!


#4

You seem to be saying that git opened your default editor to edit a file with a commit message, but that you saved the result in a different name instead. If so, git would have told you that you entered no commit message and that it therefore aborted. (You have to watch what feedback you get)


#5

I'm having this same problem. It's driving me out of my mind!!!


#6

Then the same answer applies


#7

hmm.. Now I did the following

git commit scene-2.txt |_enter
Larry/Laertes name swap in hamlet |_typed
ctrl + o |_ typed
|_enter


#8

Exit the editor so that git can continue


#9

I quit the editor the same trouble
error "Did you commit your changes to the Git repository"


#10

Not the same trouble, you fixed the other one by finishing the commit, now you have a second problem.

In the previous exercise you added scene-3 and scene-7, in this one you were supposed to add, and then un-add, scene-2, with the end result that only scene-3 and scene-7 should still be staged when committing.

If you look at your screenshot, you'll see you did it the other way around.

Go back to the previous commit with git reset HEAD^ and then add scene-7 and scene-3 and commit


#11

Thx it worked but I didn't understand anything in this tutorial


#12

Took me a while to understand too but the deal is that you are removing scene-2.txt from the staging area because it was messed it up by our "accidental" deletion. Then you commit the the part of the project that remains in the staging area (scene-3.txt and scene-7.txt): $ git commit -m "LARRY/LEARTES".
If you try and commit scene-2.txt it will error as it no longer exists in the staging area.


#13

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.