Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git &引用;无法拉取,因为您有未合并的文件";-我该如何解决这个问题?_Git - Fatal编程技术网

Git &引用;无法拉取,因为您有未合并的文件";-我该如何解决这个问题?

Git &引用;无法拉取,因为您有未合并的文件";-我该如何解决这个问题?,git,Git,我在这个网站上发现了一些类似的问题,但事实是我几乎不知道自己在做什么,也跟不上答案 我正在尝试将一名员工添加到我的公司网站。当我写 $ git pull origin gh-pages 它显示了所有这些: 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-w

我在这个网站上发现了一些类似的问题,但事实是我几乎不知道自己在做什么,也跟不上答案

我正在尝试将一名员工添加到我的公司网站。当我写

$ git pull origin gh-pages
它显示了所有这些:

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$ 
Laurences-MacBook-Pro-2:opennorth.ca Laurence$git pull-origin gh页面
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-市政-open-data-Initiaties-how-open-north-can-help.md
A_posts/2016-06-01-open-cities-strategies-A-new-initiative-by-open-north-to-help-cities-success-in-planning-and-implementation-thes-open-data-programs.md
A_posts/2016-06-08-spring-the-word-about-citizen-budget-our-innovative-online-budget-simulator.md
A_posts/2016-06-15-applicated-research-in-action-immigration-saverage-and-citizensity-canada.md
A_posts/2016-07-07-exploring-the-social-sector-s-relationship-with-data-takaways-from-data-4-impact.md
M index.html
U主题
无法拉取,因为您有未合并的文件。
请在工作树中修复它们,然后使用“git add/rm”
根据需要标记解决方案并进行提交。
Laurences-MacBook-Pro-2:opennorth.ca Laurence$
这些都是另一名员工(他对Github也知之甚少)通过pross.io发布的博客帖子。我认为她错过了将文件合并到原始分支的某个步骤

我不想删除所有这些帖子,但我不知道如何在工作树中修复它们

非常感谢您的帮助,用非常蹩脚的话来说

以下是git状态的结果:

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$ 
分支页面上的

您的分支和“来源/gh页面”出现分歧,
和分别有1个和65个不同的提交。
(使用“git pull”将远程分支合并到您的分支中)
您有未合并的路径。
(修复冲突并运行“git提交”)
要提交的更改:
修改:_data/staff.yml
修改:_layouts/default.html
删除:_posts/2013-04-05-this-week-in-open-government.md
新文件:_posts/2016-04-11-open-north-newsletter-spring-2016.md
新文件:_posts/2016-05-05-launching-and-sustaining-civility-open-data-initiaties-how-open-north-can-help.md
新文件:_posts/2016-06-01-open-cities-strategies-a-new-initiative-by-open-north-to-help-cities-success-in-planning-and-implementation-thes-open-data-programs.md
新文件:_posts/2016-06-08-spring-the-word-about-citizen-budget-our-innovative-online-budget-simulator.md
新文件:_posts/2016-06-15-applicated-research-in-action-immigration-harrival-and-citizensity-canada.md
新文件:_posts/2016-07-07-exploring-the-social-sector-s-relationship-with-data-takeaways-from-data-4-impact.md
修改:index.html
未合并路径:
(使用“git add…”标记分辨率)
两个修改:主题
Laurences-MacBook-Pro-2:opennorth.ca Laurence$
谢谢!
Laurence

当您的git回购协议中有未“保存”的更改时,您不能执行类似于git pull的破坏性操作,否则,您将丢失当前正在执行的所有操作

您可以在此处执行以下两项操作之一:

  • 通过运行
    git stash
    保存现有更改以备将来使用,或者
  • 提交并保存现有更改,例如:
    git add--all;git提交

在执行上述任一操作后,您将能够按照自己的意愿提取分支更改。

如果您正在进行的更改相对较小,最简单的方法可能是首先隐藏更改,进行提取,然后重新应用隐藏。此时,您可以解决任何冲突

git stash
git pull origin gh-pages
git stash pop

你能发布git状态的结果吗?你可以编辑你的原始问题来发布。注释部分可能太长了。我添加了git status的结果。是的,我看到了这个问题,但不幸的是,答案对我来说毫无意义:(或者
git reset--hard
,如果您不介意丢失更改的话。