Re: git-svn, and which branch am I on?

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

 



On Sat, Feb 28, 2009 at 3:50 AM, Daniel Pittman wrote:
>
> 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.

> ...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?

You've hit the nail on the head. The question is meaningless. Git
tracks a DAG, and a branch is just that - a branch (or 'tip', if you
will) of the DAG.

Take, for example,

o--o--o--o master
 \
  o--o--o--o feature
      \
       o--o working

Which branch did 'working' come from? 'feature' or 'master'? Say I
later delete branch 'feature', since it was going in the wrong
direction. Does the answer change? What if I simply redraw the above
so that feature and working are swapped? Does the answer change? It's
still the same tree.

You can, however, answer related questions.

'git svn info' will tell you which branch a 'git svn dcommit' will
commit to, which is usually the question you actually wanted to
answer.

'git branch -r' will tell you which remote branch your local branch is
tracking. ie. which branch, if any, a plain 'git pull' will fetch and
merge from.

See also http://thread.gmane.org/gmane.comp.version-control.git/77730/focus=77823
and surrounding thread.

Peter Harris
--
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]

  Powered by Linux