git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* strange "git clone" behavior wrt an active branch
@ 2008-09-28 12:05 Leo Razoumov
  2008-09-28 12:37 ` Santi Béjar
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Razoumov @ 2008-09-28 12:05 UTC (permalink / raw)
  To: Git Mailing List

Hi All,
I am using the latest stable version git-1.6.0.2.

The man page for git-clone states explicitly that "git clone"

" Clones a repository into a newly created directory, ...[snip]...
  and creates and checks out an initial branch equal to the
  cloned repository's currently active branch. "

I noticed that while my active branch "My" happens to point to the
same commit as the "master" the git clone will check out master
instead of My (currently active branch). Is it a bug?

Here is the example that demontrates the problem

~> mkdir tmp
~/tmp> git init
~/tmp> cat > txt
some text
~/tmp> git add .
~/tmp> git ci -m 'init ci'
~/tmp> git branch -a
* master
~/tmp> git co -b My
~/tmp> git branch -a
* My
  master

Now "My" is my active branch in 'tmp' repo. It points to the same
commit as the master. Now let us clone it

~/tmp> cd ..
~> git clone tmp tmp1
~> cd tmp1
~/tmp1> git branch -a
* master
  origin/HEAD
  origin/My
  origin/master

In the cloned repository 'tmp1',  master branch is active. No local
tracking branch for "My" was created. I think this behavior
contradicts the man page. Is it a bug or feature??

Thanks,
--Leo--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-28 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-28 12:05 strange "git clone" behavior wrt an active branch Leo Razoumov
2008-09-28 12:37 ` Santi Béjar
2008-09-28 13:23   ` Leo Razoumov
2008-09-28 19:43     ` Santi Béjar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).