简体   繁体   English

如何从创建实际分支的地方知道分支的名称?

[英]How to know the name of the branch from where actual branch is created?

In git how to find the name of the branch from which my actual branch created? 在git中如何找到实际分支创建的分支名称? Example: I created my development branch(dev-feature) from integration branch(dev-int). 示例:我从集成分支(dev-int)创建了我的开发分支(dev-feature)。 How to trace the integration from feature branch? 如何从功能分支跟踪集成?

You can't. 你不能

You branch off from a commit , not from a branch. 您从提交分支,而不是分支。 Branch is just a temporary tag that moves with commits while active. 分支只是一个临时标记,在活动时会随提交一起移动。

Say there's a commit 0123456 where you have branch A and B. You make branch C. Which branch did you branch off of? 假设有一个提交0123456,其中有分支A和B。创建分支C。分支出哪个分支? The real answer is "neither" - you branched off from 0123456. 真正的答案是“都不是”-您从0123456分支出来。

Also, branches don't remember where they started; 而且,分支机构不记得他们从哪里开始。 the only thing you can do is trace the history back, and find where that history attached to the history of another branch. 您唯一可以做的就是追溯历史记录,并找到该历史记录附加到另一个分支的历史记录的位置。 For example, to see where exactly def-feature history meets dev-int history, 例如,要查看def-feature历史与dev-int历史确切相遇的地方,

git merge-base def-feature dev-int

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM