Git合并报告“已经是最新的”虽然有区别 [英] Git merge reports "Already up-to-date" though there is a difference

查看:930
本文介绍了Git合并报告“已经是最新的”虽然有区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



主分支和测试分支之间存在差异。

两个分支都提交了所有更改。



如果我这样做:

 
git checkout master

git diff test

出现一个充满变化的屏幕,显示不同之处。我想合并测试分支中的变化,所以:

 git merge test 

但是,得到消息已经最新



然而,检查每个不同分支下的文件清楚地显示了差异。



这里有什么问题,我该如何解决它?

解决方案

消息Already up-to -date表示来自您尝试合并的分支的所有更改已被合并到您当前所在的分支中。更具体地说,它意味着你试图合并的分支是你当前分支的父代。恭喜,这是你做过的最简单的合并。 :)



使用 gitk 来查看您的存储库。 test分支的标签应该位于master分支标签下方的某个位置。



您的分支是相对于其父分支的最新分支。根据合并,自上次合并后,父项没有任何新的更改。这并不意味着分支是相同的,因为你的工作分支可以有很多变化,听起来就像你一样。

I have a git repository with 2 branches: master and test.

There are differences between master and test branches.

Both branches have all changes committed.

If I do:

git checkout master
git diff test

A screen full of changes appears showing the differences. I want to merge the changes in the test branch and so do:

git merge test

But get the message "Already up-to-date"

However, examining files under each different branch clearly shows differences.

What's the problem here and how do I resolve it?

解决方案

The message "Already up-to-date" means that all the changes from the branch you’re trying to merge have already been merged to the branch you’re currently on. More specifically it means that the branch you’re trying to merge is a parent of your current branch. Congratulations, that’s the easiest merge you’ll ever do. :)

Use gitk to take a look at your repository. The label for the "test" branch should be somewhere below your "master" branch label.

Your branch is up-to-date with respect to its parent. According to merge there are no new changes in the parent since the last merge. That does not mean the branches are the same, because you can have plenty of changes in your working branch and it sounds like you do.

这篇关于Git合并报告“已经是最新的”虽然有区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆