【发布时间】:2015-10-07 10:30:31
【问题描述】:
我正在阅读 Michael Hartl 的“Ruby 教程”的第 5 章。我试图合并分支,在错误的分支上,把自己带进了兔子洞。在做了一些回溯之后,我已经走得很远了,但现在这又是我的问题了。
****Captains-iMac:sample_app owner$ git pull origin master
U app/views/layouts/application.html.erb
U app/views/static_pages/home.html.erb
U config/routes.rb
U test/controllers/static_pages_controller_test.rb
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.****
主分支是目前对我来说正确的分支。对一个完整的新手有什么建议吗?
【问题讨论】:
-
我认为你必须手动合并文件以避免冲突。
-
有几种方法可以解决您的问题。问题是你关心你的本地变化吗?或者你不介意丢弃它们。显示您的
git status输出 -
在分支 master 你的分支和 'origin/master' 已经分道扬镳,分别有 4 和 2 个不同的提交。 (使用“git pull”将远程分支合并到你的)你有未合并的路径。 (修复冲突并运行“git commit”)未合并的路径:(使用“git add
...”来标记解析)都修改了:app/views/layouts/application.html.erb 都添加了:app/views/ static_pages/home.html.erb 均已修改:config/routes.rb 均已添加:test/controllers/static_pages_controller_test.rb 未添加任何更改以提交(使用“git add”和/或“git commit -a”)
标签: ruby-on-rails git