我已经使用了以下命令,但在执行变基操作时有些困惑 - 在下面的命令中,ours和theirs分别代表什么?
git checkout app/dashboard-sprint-5
git rebase app/demandware
我知道当前的分支是app/dashboard-sprint-5
,当我执行变基时,
app/dashboard-sprint-5
将被应用在app/demandware
之上。
在分支方面,“ours”和“theirs”是什么意思?
我查看了链接,但不满意。
我已经使用了以下命令,但在执行变基操作时有些困惑 - 在下面的命令中,ours和theirs分别代表什么?
git checkout app/dashboard-sprint-5
git rebase app/demandware
我知道当前的分支是app/dashboard-sprint-5
,当我执行变基时,
app/dashboard-sprint-5
将被应用在app/demandware
之上。
在分支方面,“ours”和“theirs”是什么意思?
我查看了链接,但不满意。
ours
意味着基础分支。ours
将是 app/demandware
,因为首先 git 将我们移到这里,然后应用来自 app/dashboard-sprint-5
的更改,这将是 theirs
。ours
单词的说明:
因为 git 变基会使用给定的策略将工作分支中的每个提交都重播在 <upstream> 分支顶部,使用 ours 策略只是丢弃 <branch> 的所有补丁,这没什么意义。
Before rebasing:
A--B--C (master)
'--D--E (devel, HEAD)
Reset HEAD to master:
A--B--C (master, HEAD)
'--D--E (devel)
Cherry-pick D, E.
A--B--C (master)
| '-- D'--E' (HEAD)
'--D--E (devel)
HEAD becomes "ours" and the old devel branch "theirs".
^^^^ ^^^^^^
On success, repoint devel to E':
A--B--C (master)
'--D'--E' (devel, HEAD)
ours
: thetarget-branch
,theirs
: thecurrent-branch
- undefined