是否有命令说出我们是哪个分支? [英] Is there a command to say which branch is ours or theirs?
问题描述
网络上有很多SO答案和教程,说哪个分支是我们的和哪个分支是他们的,这取决于它是否是一个基础或合并,并说明为什么通常使用方便的表格,以及手册页和
There are plenty of SO answers and tutorials on the web that say there is a difference between which branch is ours and which branch is theirs depending on whether it's a rebase or a merge, and explain why, usually with a handy table, as do the man pages and online docs (sans the table).
Thing is, I don't care to remember. I'm not a fan of cognitive load for trivial things that the computer should be able to tell me or simply show me.
Is there a command or ENV var or suchlike that contains this information? (A search of my env brings up nothing but maybe I need to enable something first). The kind of thing I can stick in the prompt would be perfect. If it can handle the middle of rebase with a conflict where the target branch becomes a reference to the commit reached, that would be even better.
Judging by the amount of confusion and warnings about this you'll be doing everyone a favour by sharing if there is.
Any help or insight will be much appreciated.
As I explained here:
whatever HEAD's pointing to is "ours"
The one tool that makes cristal clear what is ours vs theirs is VSCode.
See "Resolve merge conflicts"
- The current change are ours.
- The incoming change are theirs.
这篇关于是否有命令说出我们是哪个分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!