Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the father branch in git? [duplicate]

Tags:

git

Possible Duplicate:
Find the parent branch of a branch

I have made a new feature branch but I have forgotten form where did I branch this feature branch. Now the feature is complete but I don't know in which branch I have to merge Who do I find the branch that I have branched from?

like image 768
user1796624 Avatar asked Dec 05 '12 14:12

user1796624


People also ask

How do I find my parent branch branch?

You can use git branch --contains to list all the branches descended from the tip of develop , then use grep to make sure feature is among them.

How can you tell if two branches are identical?

In order to compare two branches easily, you have to use the “git diff” command and provide the branch names separated by dots. Using this command, Git will compare the tip of both branches (also called the HEAD) and display a “diff” recap that you can use to see modifications.


2 Answers

I believe you can use gitk or git-log to better visualize your commits history.

Like this:

gitk --all 

or

git log --graph --decorate
like image 112
josemando Avatar answered Oct 03 '22 14:10

josemando


You can a list of child branches by typing: git branch --contains

Only if you don't have many branches that could be the parent branch, I think it could be useful

like image 41
yacon Avatar answered Oct 03 '22 13:10

yacon