Unexpected message with git pull upstream master


#1

I’ve been following along with the instructions in the “More involved but proper way” video for adding my google-homepage to the curriculum. Everything worked fine until I entered ‘git pull upstream master’ and got the following message:

Marks-MacBook:curriculum mnh$ git pull upstream master
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 13 (delta 5), reused 5 (delta 4), pack-reused 0
Unpacking objects: 100% (13/13), done.
From https://github.com/TheOdinProject/curriculum
 * branch                master     -> FETCH_HEAD
 * [new branch]          master     -> upstream/master
hint: Waiting for your editor to close the file... 
Merge branch 'master' of https://github.com/TheOdinProject/curriculum

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~                                                                                                                                                                                                         
~                                                                                                                                                                                                         
~                  

The ~ continue to the bottom of the screen and are followed by this message: “~/TOP/curriculum/.git/MERGE MSG” 7L, 297C

What should I do?


#2

It’s waiting for a merge message. You can try q for quit to proceed or maybe just hit return on the keyboard depending on what editor it is trying to use.


#3

Thanks for taking the time to reply. The only way I was able to proceed was by closing terminal.

The main source of my confusion is that the video suggests doing git pull upstream master before doing git push origin master so as to, as I understand it, make my local forked clone up-to-date. However, git doesn’t let me pull upstream master until I commit my changes.

So, I committed and added my changes to master. Now my fork on GitHub (https://github.com/MrkH615/curriculum) is 2 commits ahead and 73 commits behind The Odin Project: Master. This seems like I’ve made a mistake somewhere that I need to fix before submitting a pull request on GitHub. What’s my mistake here, if any?


#4

Yeah, you can’t merge in an upstream while you haven’t committed your changes because you would lose them all with file overwrites. Usually you could do something like git pull upstream master, then make the changes, then once again do git pull upstream master and then deal with any merge conflicts that might arise.

If you try git pull upstream master and end up with a lot of merge commits it might be easier to just start over.


#5

Ok, thanks, I think I’d better review the learning materials and just start over.