1

I found some similar questions on this website, but truth is that I barely know what I'm doing and can't keep up with answers.

I'm trying to add an employee to my company website. When I wrote

$ git pull origin gh-pages

it came up showing all of this:

Laurences-MacBook-Pro-2:opennorth.ca Laurence$ git pull origin gh-pages
M   _data/staff.yml
M   _layouts/default.html
D   _posts/2013-04-05-this-week-in-open-government.md
A   _posts/2016-04-11-open-north-newsletter-spring-2016.md
A   _posts/2016-05-05-launching-and-sustaining-municipal-open-data-initiatives-how-open-north-can-help.md
A   _posts/2016-06-01-open-cities-strategies-a-new-initiative-by-open-north-to-help-cities-succeed-in-planning-and-implementing-their-open-data-programs.md
A   _posts/2016-06-08-spreading-the-word-about-citizen-budget-our-innovative-online-budget-simulator.md
A   _posts/2016-06-15-applied-research-in-action-immigration-refugee-and-citizenship-canada.md
A   _posts/2016-07-07-exploring-the-social-sector-s-relationship-with-data-takeaways-from-data-4-impact.md
M   index.html
U   theme
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution and make a commit.
Laurences-MacBook-Pro-2:opennorth.ca Laurence$ 

Those are blog posts that another employee (who also has little knowledge about Github) has been posting through Prose.io. I think she's missing some kind of step to merge the files to the original branch?

I don't want to erase all these posts, but I don't know how to fix them up in the work tree.

Any help, in super lamen terms, is greatly appreciated.

Here is the results from git status:

On branch gh-pages
Your branch and 'origin/gh-pages' have diverged,
and have 1 and 65 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
You have unmerged paths.
  (fix conflicts and run "git commit")

Changes to be committed:

    modified:   _data/staff.yml
    modified:   _layouts/default.html
    deleted:    _posts/2013-04-05-this-week-in-open-government.md
    new file:   _posts/2016-04-11-open-north-newsletter-spring-2016.md
    new file:   _posts/2016-05-05-launching-and-sustaining-municipal-open-data-initiatives-how-open-north-can-help.md
    new file:   _posts/2016-06-01-open-cities-strategies-a-new-initiative-by-open-north-to-help-cities-succeed-in-planning-and-implementing-their-open-data-programs.md
    new file:   _posts/2016-06-08-spreading-the-word-about-citizen-budget-our-innovative-online-budget-simulator.md
    new file:   _posts/2016-06-15-applied-research-in-action-immigration-refugee-and-citizenship-canada.md
    new file:   _posts/2016-07-07-exploring-the-social-sector-s-relationship-with-data-takeaways-from-data-4-impact.md
    modified:   index.html

Unmerged paths:
  (use "git add <file>..." to mark resolution)

    both modified:   theme

Laurences-MacBook-Pro-2:opennorth.ca Laurence$ 

Thanks! Laurence

  • Can you post the result of `git status`? You can edit your original question to post that. It's probably too long for the comment section. – Haozhun Aug 04 '16 at 17:33
  • 1
    http://stackoverflow.com/questions/26376832/why-does-git-say-pull-is-not-possible-because-you-have-unmerged-files – David Neiss Aug 04 '16 at 17:42
  • I added the results from git status. Yes, I'd seen that question, but unfortunately the answer means absolutely nothing to me :( – Laurence Harvey Leclerc Aug 04 '16 at 17:43
  • Does this answer your question? [Why does git say "Pull is not possible because you have unmerged files"?](https://stackoverflow.com/questions/26376832/why-does-git-say-pull-is-not-possible-because-you-have-unmerged-files) – Flimm Jan 03 '22 at 12:36

2 Answers2

2

You can't do a destructive operation like git pull when your git repo has changes in it that haven't been 'saved' -- otherwise, you would lose all of the stuff you're currently doing!

You can do one of two things here:

  • Either save your existing changes for later by running git stash, OR
  • Commit and save your existing changes, eg: git add --all; git commit.

After doing either of those operations, you'll be able to pull your branch changes like you want.

merlin2011
  • 71,677
  • 44
  • 195
  • 329
rdegges
  • 32,786
  • 20
  • 85
  • 109
0

If the change you are making on your side is relatively small, the easiest way to do this is probably to first stash your changes, do the pull, then re-apply the stash. At this point you can resolve any conflicts.

git stash
git pull origin gh-pages
git stash pop
merlin2011
  • 71,677
  • 44
  • 195
  • 329