简体   繁体   中英

Finding the branch a given branch branched from

I have a branch in a GitHub repository, how can I find the branch it branched from? When I look at the commit history within the branch, it shows me all the commits for the branch but nothing seems to mark to the first commit where it branched (ie the first commit of the branch).

i suggest to use the CLI on your local repo:

git config --global color.ui auto
git log --graph --oneline --all

Scroll until you see the branches that you search for.

There are also some other alternative as well of course like:

git merge-base 

git doesn't have a notion of "branching points". A git commit can be through of as a node in a singly linked list, each commit knows about it's parent(s) only.

With that said, to get an overview of the history of a git repository you can use

git log --oneline --graph --all --decorate

and all it's variants.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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