git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to find where a branch was taken from.

From
PGPaul Gardiner <osronline@glidos.net>
Date
Mar 21, 2008, 09:05 UTC
Message-ID
<47E37A63.9070209@glidos.net>

I need a command that will find the remote branch from which the currently checked out branch was started. I don't know git very well, and the only way I can think to do it so far is to iterate over the remote branches and find the one for which git-rev-list <branch>..HEAD gives the smallest number of objects. I'm guessing there must be a better way. Any ideas?

Cheers,
	Paul.
Next: Junio C Hamano
Message 1 of 12 in “How to find where a branch was taken from.”
  1. Paul GardinerMar 21, 2008
  2. Junio C HamanoMar 21, 2008
  3. Junio C HamanoMar 21, 2008
  4. Avery PennarunMar 21, 2008
  5. Charles BaileyMar 21, 2008
  6. Avery PennarunMar 21, 2008
  7. Dmitry PotapovMar 21, 2008
  8. Daniel BarkalowMar 21, 2008
  9. J. Bruce FieldsMar 21, 2008
  10. Paul GardinerMar 22, 2008
  11. Jeff KingMar 22, 2008
  12. Paul GardinerMar 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.