Merge Conflict II - Step 5


#1

I worked through the steps as instructed but I can't get past Step 5. Here's what happened:

$ git checkout master                                                       
Switched to branch 'master'                                                 
$ git merge fencing                                                        
Auto-merging resume.txt                                                     
CONFLICT (content): Merge conflict in resume.txt                            
Automatic merge failed; fix conflicts and then commit the result.           
$ git add resume.txt                                                        
$ git commit resume.txt -m "Resolve merge conflict"                         
fatal: cannot do a partial commit during a merge.

That last bit is Step 5 - cannot do a partial commit during a merge. But I followed all instructions so I'm really confused. Does anyone know what I did wrong?

I went back two exercises and redid them, following instructions very carefully. But when I get to this Step 5 I'm still getting the error message. I used the command line to go back into the fencing branch, and commit there. Then it let me pass the exercise, but I can't get past the next one - I got a similar error message. So the problem has to be in this exercise somewhere.


#2

Hi @amandathewebdev, looks like you are very close to getting through this lesson! Nice work.

The reason you are getting the fatal: cannot do a partial commit during a merge. error is because you're attempting to commit the file, resume.txt. This is not quite the correct syntax for Git. Instead, just do:

git commit -m "Resolve merge conflict"

No mention of resume.txt is needed.

Let me know if this works for you!


#3

I had this exact same issue. The instructions need to be clearer since we've been using "git commit -m "text" everywhere else.


#4

Hi @dan_asselin, your suggestion worked. I'm not sure why "resume.txt" didn't have to be included though if every other time I made a commit, I first added it by file name, then I listed the file(s) in the commit also and it worked. Did I not need to be doing that?

Thanks for your help!


#5

Hi @amandathewebdev, correct. You did not need to be specifying the file in your commit because you already did that by adding the file to the staging area. Below is the syntax for committing with the -m option:


git commit -m "Commit message 50 characters or less"

No need to specify the file : )

Using the staging area to specify which file(s) you want to commit, then committing with the syntax shown in the code snippet above will get you through all of the exercises in the Codecademy Git course.

Hope this clarifies things. Feel free to ask more questions!


#7