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

Re: How can I access remote branches in a cloned repository on my local machine?

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Oct 20, 2007, 13:53 UTC
Message-ID
<Pine.LNX.4.64.0710201449340.8248@beast.quantumfyre.co.uk>
In-Reply-To
<05B1B470-1C86-40E6-9E33-968809414537@atlasocean.com>
On Sat, 20 Oct 2007, Erich Ocean wrote:
Show 33 quoted lines
> 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
>
> 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
>
> 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:

The default fetch refspec doesn't include the remotes - after all, you normally don't want the origin for your origin ...

> How can I access remote branches in a cloned repository on my local machine?
Try something like:

git config remote.origin.fetch +refs/remotes/*:+refs/remotes/* git fetch

-- 
Julian

  ---
No matter how cynical you get, it's impossible to keep up.
Previous: Erich OceanNext: Julian Phillips
Message 2 of 5 in “How can I access remote branches in a cloned repository on my local machine?”
  1. Erich OceanOct 20, 2007
  2. Julian PhillipsOct 20, 2007
  3. Julian PhillipsOct 20, 2007
  4. [Solved] How can I access remote branches in a cloned repository on my local machine?Erich Ocean, Oct 20, 2007
  5. Jan HudecOct 20, 2007

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.