git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: Erich Ocean <erich@atlasocean.com>
Cc: git@vger.kernel.org
Subject: Re: How can I access remote branches in a cloned repository on my local machine?
Date: Sat, 20 Oct 2007 16:09:27 +0200	[thread overview]
Message-ID: <20071020140927.GC19521@efreet.light.src> (raw)
In-Reply-To: <05B1B470-1C86-40E6-9E33-968809414537@atlasocean.com>

[-- Attachment #1: Type: text/plain, Size: 2851 bytes --]

On Sat, Oct 20, 2007 at 06:15:21 -0700, Erich Ocean wrote:
> Our developer group has a shared git repository at 
> git@git.1kstudios.lan:dev.
>
> Each developer has established their own local repository by running:
>
> 	git clone git@git.1kstudios.lan:dev
> 	git config remote.origin.push master:refs/remotes/<username>/master

The paths on server are refs/remotes/<userame>/master.

It's more common to publish (push to public or shared repository) to
refs/heads. The refs/remotes namespace is normally only used when fetching.
There's nothing in git saying you can't do it your way, but there are things
that make the common way more convenient.

> Each developer then does a `git pull` to update their master branch, merges 
> their changes from their local topic branches, and then does `git push` to 
> make the results available at git@git.1kstudios.lan:dev.
>
> As the integrator, I have then been ssh'ing into the git@git.1kstudios.lan 
> machine, cd'ing to "dev" and doing:
>
> 	git merge <username>/master

Yes, because locally refs/remotes is searched when looking for unqualified
ref. But if you checked that out, git would complain it's not a branch and
created a detached head.

> to incorporate their changes after running `git diff` to see what the 
> changes are.
>
> My own development repository is set up identically to the other 
> developers.
>
> What I would like to do now is clone the git@git.1kstudios.lan:dev 
> repository on my local machine a second time, checkout a <username>/master 
> branch in that repository, and then use BBEdit's graphical diff to visually 
> see the changes between my own repository and what another developer has 
> pushed to the shared repository. I'll then merge them into my own developer 
> repository and push that to the shared repository for the rest of the 
> developers to pull from, so no longer will I merge by ssh'ing into the 
> machine with the shared repository.
>
> The problem is, when I clone git@git.1kstudios.lan:dev, the various 
> <username>/master's aren't there. I have tried a bunch of different ways, 
> but they all give me errors. For example:

By default clone only compies refs from refs/heads to refs/remotes/origin and
from refs/tags to refs/tags.

You have two options here:
 - Move the branches on server to refs/heads. Then the various
   <username>/master will be visible locally as origin/<username>/master
   (qualified names refs/remotes/origin/<username>/master -- you can of
   course call the remote differently if you want).
 - Add +refs/remotes/*:refs/remotes/origin/* to remote.origin.fetch config
   key in your local repository (I am not sure it will work properly with
   multiple source patterns with the same destination pattern, though).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2007-10-20 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20 13:15 How can I access remote branches in a cloned repository on my local machine? Erich Ocean
2007-10-20 13:53 ` Julian Phillips
2007-10-20 13:56   ` Julian Phillips
2007-10-20 14:18     ` [Solved] " Erich Ocean
2007-10-20 14:09 ` Jan Hudec [this message]

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=20071020140927.GC19521@efreet.light.src \
    --to=bulb@ucw.cz \
    --cc=erich@atlasocean.com \
    --cc=git@vger.kernel.org \
    /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).