Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.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_Pandas_Github_Merge_Git Merge - Fatal编程技术网

如何正确执行git合并工具

如何正确执行git合并工具,git,pandas,github,merge,git-merge,Git,Pandas,Github,Merge,Git Merge,我正在尝试将错误修复推送到pandasgithub存储库。推之前,我必须执行以下命令以确保我的主分支已更新: # go to the master branch git checkout master # pull changes from github git fetch upstream # update the master branch git rebase upstream/master # push it to your Github repo git push 然后,我更新本地分

我正在尝试将错误修复推送到
pandas
github存储库。推之前,我必须执行以下命令以确保我的主分支已更新:

# go to the master branch
git checkout master
# pull changes from github
git fetch upstream
# update the master branch
git rebase upstream/master
# push it to your Github repo
git push
然后,我更新本地分支:

# go to the feature branch
git checkout my-new-feature
# make a backup in case you mess up
git branch tmp my-new-feature
# rebase on master
git rebase master
git-rebase-master
失败,因为存在需要解决的冲突。为了解决这些问题,我使用了
gitmergetool
,我将其与Meld关联,Meld是一种开源工具,用于显示本地(左)、基本(中)和远程(右)文件

在本例中,我在本地文件中有一些远程文件中不存在的代码。我没有添加该代码,所以我假设在我处理本地分支时,该代码已被合并上游删除。因此,我会选择从本地删除代码,以便本地、基本和远程对齐

那么,上面的图片呢?上次我试图从远程文件中获取更改,但当我将更改推送到GitHub上时,看起来添加的空白不是来自远程文件,而是我添加的。我是否误解了远程、本地和基地的含义

对我来说,REMOTE是上游版本,LOCAL是我正在处理的本地文件,git可以进行部分合并,但需要一些手动干预才能完成

如何执行手动合并?除了我自己做的改变,我会从遥控器上拿走一切

下面的图片让我怀疑我最初对本地和远程的理解

我编写了在右边突出显示的代码

- ``concat`` will now use existing Series names if provided (:issue:`10698`).

  .. ipython:: python

     foo = pd.Series([1,2], name='foo')
     bar = pd.Series([1,2])
     baz = pd.Series([4,5])

  Previous Behavior:

  .. code-block:: python

     In [1] pd.concat([foo, bar, baz], 1)
     Out[1]:
           0  1  2
        0  1  1  4
        1  2  2  5

  New Behavior:

  .. ipython:: python

    pd.concat([foo, bar, baz], 1)
那为什么是在远程而不是本地?我希望它在本地文件中,而不是在远程文件中,因为它还没有被合并到上游。

正如我在“”中提到的

你有:

  • 本地是
    B
  • 遥控器是
    A
(我们的和他们的在重设基础期间颠倒)

因此,在GUI合并工具上下文中:

  • local引用部分重定基础的承诺:“我们的”(上游分支)
  • remote指传入的更改:“他们的”-重基之前的当前分支
git checkout A
git rebase   B    # rebase A on top of B