.REMOTE和.Local结果相反 [英] .REMOTE and .Local results are reversed

查看:162
本文介绍了.REMOTE和.Local结果相反的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用BeyondCompare作为外部Merge / Diff工具,并设置它在选项中。在管理其中一个合并冲突时,我启动了Bcomp;这会在它们的文件名中引入3个以.LOCAL,.REMOTE和.MERGED结尾的窗格,顺序与我在源代码树命令行中提到的相同。



这里是混乱和问题 -
我注意到.LOCAL文件包含.REMOTE的内容,而.REMOTE包含我的本地更改,就好像它试图以完全相反的方式理解它一样。只是不明白这一点。我在Bcomp或SourceTree中设置了错误的设置/配置,导致了相反的内容吗?



我的理解是:


  • 本地:表示我在本地进行了更改,并在拉动其他人时遇到了冲突

  • 远程:文件/内容是否具有在我之前被推送给主人,并且是我正在拉或合并的东西。



有时我在合并中看到这个文件

 <<<< HEAD 
==========
>>>>>

有人可以告诉我们什么时候可以得到它,如果我使用外部合并像Bcomp这样的工具。 GIT是否会将这些内容显示出来,我们需要手动删除它并保存文件以避免编译错误。

git rebase ,跟踪本地和远程 ,在那里我解释了rebase开关我们的(rebase开始前的当前分支)和他们的(上游分支在顶部你想rebase)。



由于 torek 我们的的确切含义是什么?他们的in git?


原因我们的他们的概念在rebase期间交换是因为rebase通过执行一系列樱桃选择,进入匿名分支HEAD模式)。

目标分支是th e匿名分支,而merge-from分支是您的原始分支(pre-rebase):

所以 - 我们的意味着匿名分支rebase正在建设中,而 - 他们的意思是我们的分行正在重新发售。

在这种情况下:

  + ------------------ -------------- + 
| LOCAL | BASE | REMOTE |
+ -------------------------------- +
|合并|
+ -------------------------------- +




  • local 引用部分重新发布的提交:我们(上游分支)
  • 远程引用传入的更改:他们的 - rebase之前的当前分支。


I am using SourceTree for performing/managing my file commits, pushes, pulls and merges.

I use BeyondCompare as the external Merge/Diff tool and have it set in the options. While managing one of the merge conflicts, I launched the Bcomp; this brings up 3 panes ending with .LOCAL, .REMOTE and .MERGED in their file names and the order is same as I mentioned in the Source Tree command line.

Here is the confusion and the issue - I notice that the .LOCAL file has the content of the .REMOTE and .REMOTE has my local changes as if it's trying to understand it in exactly opposite way. Just don't get this at all. Do I have a bad setting/config in Bcomp or SourceTree that is resulting in opposite content?

My understanding is :

  • Local : meaning the file I have made my changes locally and have got the conflict upon while pulling others
  • Remote : Is the file/content that has been pushed to pushed to the master ahead of me and is something I am pulling or merging with.

Sometimes I see this in the merged files

<<<< HEAD
    ========== 
    >>>>> 

Can someone tell what when exactly do we get it, and will it ever happen if I use external merge tool like Bcomp. Does GIT put these to indicate something, and we need to manually remove it and save the file to avoid compilation errors

解决方案

See "git rebase, keeping track of 'local' and 'remote'", where I explained a rebase switches ours (current branch before rebase starts) and theirs (the upstream branch on top you want to rebase).

As torek expained in "What is the precise meaning of "ours" and "theirs" in git?"

The reason the "ours" and "theirs" notions get swapped around during rebase is that rebase works by doing a series of cherry-picks, into an anonymous branch (detached HEAD mode).
The target branch is the anonymous branch, and the merge-from branch is your original (pre-rebase) branch:
so "--ours" means the anonymous one rebase is building while "--theirs" means "our branch being rebased".

In that context:

+--------------------------------+
| LOCAL  |     BASE     | REMOTE |
+--------------------------------+
|             MERGED             |
+--------------------------------+

  • local references the partially rebased commits: "ours" (the upstream branch)
  • remote refers to the incoming changes: "theirs" - the current branch before the rebase.

这篇关于.REMOTE和.Local结果相反的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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