3

Beginner: I was trying to do "pull" before a "push" of my new file to GitHub as system asked. When I typed git push it showed me:

Merge branch 'master' of https://github.com/Wordworth/Test2
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~                                                                               
-- INSERT --

What to do with this? the goal is to push my file after commit to GitHub repo which already exists with the same name is local one. Any hints?

Don Branson
  • 13,631
  • 10
  • 59
  • 101
beginner
  • 269
  • 1
  • 3
  • 6

1 Answers1

5

This is normal behavior. It's merging the remote contents with your local contents. Save this commit message, and the pull will complete. Then issue your push.

git pull does two things behind the scenes - first, a fetch to pull all the contents from the remote repo, then a merge of the remote contents of the current branch with your local contents.

That file you're seeing is a suggested message for the commit of the merge results.

Don Branson
  • 13,631
  • 10
  • 59
  • 101
  • 3
    Thanks. It worked. Although there was a difficulty to *type* and *save* that commit as it was unusual input: 1. press "i" 2. write your merge message 3. press "esc" 4. write ":wq" 5. then press enter (as people say it is from Vi/Vim editor within Terminal) – beginner Jul 17 '16 at 14:10
  • You can change the editor git uses: http://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits – Don Branson Jul 17 '16 at 14:38