Re: How can i find the origin of a branch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/6/15 Dotan Barak <dotanba@xxxxxxxxx>:
> Is it possible to find the origin of a branch?
> (the remote repository that this branch was cloned and checked out from)

Look for a repository which has the smallest count of commits
in common with the branch.

You can use git merge-base to find all the commits which could
possible be the point of divergence (aka "merge base"). Then
you can find all the remote branches which have the "merge bases"
(git branch --contains <base>). Any of that remote branches
could have been the origin of your local branch.

You'll seldom (if ever again) need that, I think.

P.S. You don't clone branches. Not as such. You clone repositories,
which have the commits, which a branch (as in "reference") can point to.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]