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

git-svn, and which branch am I on?

From
Daniel Pittman <daniel@rimspace.net>
Date
Feb 28, 2009, 08:50 UTC
Message-ID
<87ljrr7xof.fsf@rimspace.net>
G'day.

I recently got asked a question about git-svn that I had no idea how to answer, and which I am actually curious to know how to find out.

The general question was: in git, how do I identify where this branch came from?

Specifically, this was about 'git svn', but also generally how to identify this information in git.

So, with a repository branch layout like this:
  master        (local)
  testing       (local)
  trunk         (remote)
  v100          (remote)
How would I find out which remote branch master and trunk came from?

To restate that, because I am not sure if that is clear, given this layout of branches:

     trunk (remote)
     |
 o---o---o---o---o  branch master
  \
   \
    o---o---o---o branch testing
    |
    v100 (remote)

How can I identify that 'testing' came from the 'v100' branch, and that master came from the 'trunk' branch?

Ideally, I would like to work this out on the command line, without needing to reference gitk or another graphical tool, but even a solution that used them would be fine.

Initially I figured there would be some equivalent of the Mercurial 'glog' output available, showing this; for reference the second and third examples here are what I was envisaging: http://www.selenic.com/mercurial/wiki/index.cgi/GraphlogExtension

(from that display I could infer where testing and master came from,
 rather than directly getting the answer, but that is just fine.)

...and, finally, is the reason that I am finding it hard to explain this because I have an expectation of how things work that doesn't match up with git? In other words, is the question actually meaningless?

Regards,
        Daniel
Next: Björn Steinbrink
Message 1 of 4 in “git-svn, and which branch am I on?”
  1. Daniel PittmanFeb 28, 2009
  2. Björn SteinbrinkFeb 28, 2009
  3. Peter HarrisFeb 28, 2009
  4. Jakub NarebskiFeb 28, 2009

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.