Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.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_Git Rebase - Fatal编程技术网

Git 轻松解决重设基础冲突

Git 轻松解决重设基础冲突,git,git-rebase,Git,Git Rebase,当我从我的功能分支执行:git pull--rebase时,我在许多我从未编辑过的文件中遇到冲突。为了消除这些冲突,我对每个冲突的文件执行以下命令集 git checkout --ours . git add . git rebase --continue 恼人的是,每次冲突我都要执行这个。有没有办法用自定义命令配置git,以便所有命令都能立即执行 比如: If(featureBranch_04) { foreach(conflicts) if(conflictedFil

当我从我的功能分支执行:
git pull--rebase
时,我在许多我从未编辑过的文件中遇到冲突。为了消除这些冲突,我对每个冲突的文件执行以下命令集

git checkout --ours .

git add .

git rebase --continue
恼人的是,每次冲突我都要执行这个。有没有办法用自定义命令配置git,以便所有命令都能立即执行

比如:

If(featureBranch_04) {
   foreach(conflicts)
      if(conflictedFile != index.jsp) {
          git checkout --ours .
          git add .
          git rebase --continue
      }
   }
}
我可以在git config中使用类似的函数吗

工作流程是:首先我将主分支合并到
featureBranch\u 04
,然后从
featureBranch\u 04
分支中
git pull--rebase

您可以尝试:

git fetch
git rebase -s recursive -X theirs origin/featureBranch_04

这可能会影响到rebase的合并部分。

首先为什么要执行git pull--rebase?为什么不干脆
git pull
,然后重新设置分支的基础呢?既然重新基础颠倒了“我们的/他们的”感觉,-s他们的”不是正确的吗?或者rebase是否会更改用户提供的参数以匹配感知交换?@torek谢谢。固定的。我应该知道,我写了很多关于这方面的文章: