git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Matthew Lear <matt@bubblegen.co.uk>
Cc: git@vger.kernel.org
Subject: Re: Unable to checkout a branch after cloning
Date: Tue, 11 Aug 2009 14:04:25 +0200	[thread overview]
Message-ID: <4A815E49.60406@drmicha.warpmail.net> (raw)
In-Reply-To: <4A814392.4080803@bubblegen.co.uk>

Matthew Lear venit, vidit, dixit 11.08.2009 12:10:
> Hi all,
> 
> Apologies for perhaps a silly question, but I'd very much appreciate a
> little bit of assistance.
> 
> I've set up a git repository on a machine accessible from the internet
> with the intention to share code with another developer. We clone the
> repository, commit changes then push back as you'd expect. The server
> runs gitweb for repository browsing. Clients are running git v1.6.0.6.
> 
> When I created the initial repository I also created two additional
> branches - 'upstream' and 'custom'. The former is to act as a 'vendor
> branch' and the latter contains code specific to the custom platform
> that we're working on. The master branch contains merges from the
> upstream branch and also changes that we've made. The custom branch
> contains merges from master with custom platform specific changes.
> 
> I've committed changes and on both upstream and custom branches as work
> progressed, merged them where appropriate, added tags etc and pushed
> everything to the remote repository. No problem. I can view the
> branches, tags etc in gitweb and everything looks fine.
> 
> However, I can clone a new repository just fine but I'm unable to
> checkout the upstream or custom branches. After cloning, only the master
> branch is available, ie:
> 
>> git checkout upstream
> error: pathspec 'upstream' did not match any file(s) known to git.
> 
>> git branch -a
> * master
>   origin/HEAD
>   origin/master
> 
> .git/config:
> 
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = false
>         logallrefupdates = true
> [remote "origin"]
>         url = https://mysite/git/project.git
>         fetch = +refs/heads/*:refs/remotes/origin/*
> [branch "master"]
>         remote = origin
>         merge = refs/heads/master
> 
> But the initial local repository where I work (ie created the branches,
> committed changes, tag, push etc) seems to be fine, ie
> 
>> git checkout upstream
> Switched to branch "upstream"
> 
>> git branch -a
>   custom
> * master
>   upstream
> 
> .git/config:
> 
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = false
>         logallrefupdates = true
> [remote "origin"]
>         url = https://mysite/git/project.git
>         fetch = +refs/heads/*:refs/remotes/origin/*
> 
> 
> Developers need to be able to clone the repository and then switch to
> the appropriate branch in order to work. However it seems that after a
> clone, only the master branch is available.
> 
> Why is this?
> 
> Any help would be much appreciated indeed.

If I understand you correctly you have 3 repos: the "initial" one on
which everything is as expected, the "server" one and the "new clone"
which is missing branches.

Now: How's the server one doing, i.e. what does "git ls-remote
https://mysite/git/project.git" say? I suspect that one either does not
have the branches (you haven't told us how you pushed) or in the wrong
place (remotes/).

Michael

  reply	other threads:[~2009-08-11 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 10:10 Unable to checkout a branch after cloning Matthew Lear
2009-08-11 12:04 ` Michael J Gruber [this message]
2009-08-11 12:17   ` Matthew Lear
2009-08-11 13:55     ` Michael J Gruber
2009-08-11 14:24       ` Matthew Lear
2009-08-11 14:32         ` Michael J Gruber
2009-08-11 14:54           ` Matthew Lear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A815E49.60406@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=matt@bubblegen.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).