{"thread":{"id":"10393","subject":"How can I access remote branches in a cloned repository on my local machine?","startedAt":"2007-10-20T13:15:21Z","lastAt":"2007-10-20T14:18:46Z","messageCount":5,"participants":["Erich Ocean","Julian Phillips","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56702","messageId":"05B1B470-1C86-40E6-9E33-968809414537@atlasocean.com","threadId":"10393","inReplyTo":null,"subject":"How can I access remote branches in a cloned repository on my local machine?","fromName":"Erich Ocean","fromEmail":"erich@atlasocean.com","sentAt":"2007-10-20T13:15:21Z","receivedAt":"2007-10-20T13:15:21Z","isPatch":false,"sender":{"key":"erich@atlasocean.com","avatar":null},"body":"Our developer group has a shared git repository at git@git. \n1kstudios.lan:dev.\n\nEach developer has established their own local repository by running:\n\n\tgit clone git@git.1kstudios.lan:dev\n\tgit config remote.origin.push master:refs/remotes/<username>/master\n\nEach developer then does a `git pull` to update their master branch,  \nmerges their changes from their local topic branches, and then does  \n`git push` to make the results available at git@git.1kstudios.lan:dev.\n\nAs the integrator, I have then been ssh'ing into the git@git. \n1kstudios.lan machine, cd'ing to \"dev\" and doing:\n\n\tgit merge <username>/master\n\nto incorporate their changes after running `git diff` to see what the  \nchanges are.\n\nMy own development repository is set up identically to the other  \ndevelopers.\n\nWhat I would like to do now is clone the git@git.1kstudios.lan:dev  \nrepository on my local machine a second time, checkout a <username>/ \nmaster branch in that repository, and then use BBEdit's graphical  \ndiff to visually see the changes between my own repository and what  \nanother developer has pushed to the shared repository. I'll then  \nmerge them into my own developer repository and push that to the  \nshared repository for the rest of the developers to pull from, so no  \nlonger will I merge by ssh'ing into the machine with the shared  \nrepository.\n\nThe problem is, when I clone git@git.1kstudios.lan:dev, the various  \n<username>/master's aren't there. I have tried a bunch of different  \nways, but they all give me errors. For example:\n\n > logan-2:~ ocean$ git clone git@git.1kstudios.lan:dev commiters\n > Initialized empty Git repository in /Users/ocean/commiters/.git/\n > git@git.1kstudios.lan's password:\n > remote: Generating pack...\n > remote: Done counting 7029 objects.\n > remote: Deltifying 7029 objects...\n > remote:  100% (7029/7029) done\n > Indexing 7029 objects...\n > remote: Total 7029 (delta 3334), reused 2456 (delta 1154)\n >  100% (7029/7029) done\n > Resolving 3334 deltas...\n >  100% (3334/3334) done\n > Checking 3864 files out...\n >  100% (3864/3864) done\n > logan-2:~ ocean$ cd commiters\n > logan-2:~/commiters ocean$ git branch\n > * masterlogan-2:~/commiters ocean$ git checkout -b jchumley/master  \njchumley\n > git checkout: updating paths is incompatible with switching  \nbranches/forcing\n\nHow can I access remote branches in a cloned repository on my local  \nmachine?\n\nThanks!\n\nErich\n"},{"id":"56704","messageId":"Pine.LNX.4.64.0710201449340.8248@beast.quantumfyre.co.uk","threadId":"10393","inReplyTo":"05B1B470-1C86-40E6-9E33-968809414537@atlasocean.com","subject":"Re: How can I access remote branches in a cloned repository on my local machine?","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-10-20T13:53:45Z","receivedAt":"2007-10-20T13:53:45Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Sat, 20 Oct 2007, Erich Ocean wrote:\n\n> Our developer group has a shared git repository at git@git.1kstudios.lan:dev.\n>\n> Each developer has established their own local repository by running:\n>\n> \t git clone git@git.1kstudios.lan:dev\n> \t git config remote.origin.push master:refs/remotes/<username>/master\n>\n> Each developer then does a `git pull` to update their master branch, merges \n> their changes from their local topic branches, and then does `git push` to \n> make the results available at git@git.1kstudios.lan:dev.\n>\n> As the integrator, I have then been ssh'ing into the git@git.1kstudios.lan \n> machine, cd'ing to \"dev\" and doing:\n>\n> \tgit merge <username>/master\n>\n> to incorporate their changes after running `git diff` to see what the changes \n> are.\n>\n> My own development repository is set up identically to the other developers.\n>\n> What I would like to do now is clone the git@git.1kstudios.lan:dev repository \n> on my local machine a second time, checkout a <username>/master branch in \n> that repository, and then use BBEdit's graphical diff to visually see the \n> changes between my own repository and what another developer has pushed to \n> the shared repository. I'll then merge them into my own developer repository \n> and push that to the shared repository for the rest of the developers to pull \n> from, so no longer will I merge by ssh'ing into the machine with the shared \n> repository.\n>\n> The problem is, when I clone git@git.1kstudios.lan:dev, the various \n> <username>/master's aren't there. I have tried a bunch of different ways, but \n> they all give me errors. For example:\n\nThe default fetch refspec doesn't include the remotes - after all, you \nnormally don't want the origin for your origin ...\n\n> How can I access remote branches in a cloned repository on my local machine?\n\nTry something like:\n\ngit config remote.origin.fetch +refs/remotes/*:+refs/remotes/*\ngit fetch\n\n-- \nJulian\n\n  ---\nNo matter how cynical you get, it's impossible to keep up.\n"},{"id":"56705","messageId":"Pine.LNX.4.64.0710201455540.8248@beast.quantumfyre.co.uk","threadId":"10393","inReplyTo":"Pine.LNX.4.64.0710201449340.8248@beast.quantumfyre.co.uk","subject":"Re: How can I access remote branches in a cloned repository on my local machine?","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-10-20T13:56:57Z","receivedAt":"2007-10-20T13:56:57Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Sat, 20 Oct 2007, Julian Phillips wrote:\n\n>>  The problem is, when I clone git@git.1kstudios.lan:dev, the various\n>>  <username>/master's aren't there. I have tried a bunch of different ways,\n>>  but they all give me errors. For example:\n>\n> The default fetch refspec doesn't include the remotes - after all, you \n> normally don't want the origin for your origin ...\n>\n>>  How can I access remote branches in a cloned repository on my local\n>>  machine?\n>\n> Try something like:\n>\n> git config remote.origin.fetch +refs/remotes/*:+refs/remotes/*\n\nsorry, that should have been:\ngit config remote.origin.fetch +refs/remotes/*:refs/remotes/*\n\n> git fetch\n\n-- \nJulian\n\n  ---\n\"The National Association of Theater Concessionaires reported that in\n1986, 60% of all candy sold in movie theaters was sold to Roger Ebert.\"\n \t\t-- D. Letterman\n"},{"id":"56707","messageId":"20071020140927.GC19521@efreet.light.src","threadId":"10393","inReplyTo":"05B1B470-1C86-40E6-9E33-968809414537@atlasocean.com","subject":"Re: How can I access remote branches in a cloned repository on my local machine?","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-10-20T14:09:27Z","receivedAt":"2007-10-20T14:09:27Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Sat, Oct 20, 2007 at 06:15:21 -0700, Erich Ocean wrote:\n> Our developer group has a shared git repository at \n> git@git.1kstudios.lan:dev.\n>\n> Each developer has established their own local repository by running:\n>\n> \tgit clone git@git.1kstudios.lan:dev\n> \tgit config remote.origin.push master:refs/remotes/<username>/master\n\nThe paths on server are refs/remotes/<userame>/master.\n\nIt's more common to publish (push to public or shared repository) to\nrefs/heads. The refs/remotes namespace is normally only used when fetching.\nThere's nothing in git saying you can't do it your way, but there are things\nthat make the common way more convenient.\n\n> Each developer then does a `git pull` to update their master branch, merges \n> their changes from their local topic branches, and then does `git push` to \n> make the results available at git@git.1kstudios.lan:dev.\n>\n> As the integrator, I have then been ssh'ing into the git@git.1kstudios.lan \n> machine, cd'ing to \"dev\" and doing:\n>\n> \tgit merge <username>/master\n\nYes, because locally refs/remotes is searched when looking for unqualified\nref. But if you checked that out, git would complain it's not a branch and\ncreated a detached head.\n\n> to incorporate their changes after running `git diff` to see what the \n> changes are.\n>\n> My own development repository is set up identically to the other \n> developers.\n>\n> What I would like to do now is clone the git@git.1kstudios.lan:dev \n> repository on my local machine a second time, checkout a <username>/master \n> branch in that repository, and then use BBEdit's graphical diff to visually \n> see the changes between my own repository and what another developer has \n> pushed to the shared repository. I'll then merge them into my own developer \n> repository and push that to the shared repository for the rest of the \n> developers to pull from, so no longer will I merge by ssh'ing into the \n> machine with the shared repository.\n>\n> The problem is, when I clone git@git.1kstudios.lan:dev, the various \n> <username>/master's aren't there. I have tried a bunch of different ways, \n> but they all give me errors. For example:\n\nBy default clone only compies refs from refs/heads to refs/remotes/origin and\nfrom refs/tags to refs/tags.\n\nYou have two options here:\n - Move the branches on server to refs/heads. Then the various\n   <username>/master will be visible locally as origin/<username>/master\n   (qualified names refs/remotes/origin/<username>/master -- you can of\n   course call the remote differently if you want).\n - Add +refs/remotes/*:refs/remotes/origin/* to remote.origin.fetch config\n   key in your local repository (I am not sure it will work properly with\n   multiple source patterns with the same destination pattern, though).\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"56708","messageId":"20CAFC3D-7684-480D-B340-C3206BA08DE5@atlasocean.com","threadId":"10393","inReplyTo":"Pine.LNX.4.64.0710201455540.8248@beast.quantumfyre.co.uk","subject":"[Solved] How can I access remote branches in a cloned repository on my local machine?","fromName":"Erich Ocean","fromEmail":"erich@atlasocean.com","sentAt":"2007-10-20T14:18:46Z","receivedAt":"2007-10-20T14:18:46Z","isPatch":false,"sender":{"key":"erich@atlasocean.com","avatar":null},"body":"Per Julian Phillips' suggestion:\n\n > logan-2:~ ocean$ cd commiters/\n > logan-2:~/commiters ocean$ git config remote.origin.fetch +refs/ \nremotes/*:refs/remotes/*\n > logan-2:~/commiters ocean$ git fetch\n > git@git.1kstudios.lan's password:\n > * refs/remotes/eocean/master: storing remote branch 'eocean/ \nmaster' of git@git.1kstudios.lan:dev\n >   commit: 06b4b2e\n > * refs/remotes/gt/master: storing remote branch 'gt/master' of  \ngit@git.1kstudios.lan:dev\n >   commit: 889a585\n > * refs/remotes/jchumley/master: storing remote branch 'jchumley/ \nmaster' of git@git.1kstudios.lan:dev\n >   commit: 18cead3\n > logan-2:~/commiters ocean$ git branch\n >   +refs/remotes/eocean/master\n >   +refs/remotes/gt/master\n >   +refs/remotes/jchumley/master\n > * master\n > logan-2:~/commiters ocean$ git checkout  +refs/remotes/jchumley/ \nmaster\n > Switched to branch \"+refs/remotes/jchumley/master\"\n\nBest, Erich\n\nOn Oct 20, 2007, at 6:56 AM, Julian Phillips wrote:\n\n> On Sat, 20 Oct 2007, Julian Phillips wrote:\n>\n>>>  The problem is, when I clone git@git.1kstudios.lan:dev, the various\n>>>  <username>/master's aren't there. I have tried a bunch of  \n>>> different ways,\n>>>  but they all give me errors. For example:\n>>\n>> The default fetch refspec doesn't include the remotes - after all,  \n>> you normally don't want the origin for your origin ...\n>>\n>>>  How can I access remote branches in a cloned repository on my local\n>>>  machine?\n>>\n>> Try something like:\n>>\n>> git config remote.origin.fetch +refs/remotes/*:+refs/remotes/*\n>\n> sorry, that should have been:\n> git config remote.origin.fetch +refs/remotes/*:refs/remotes/*\n>\n>> git fetch\n>\n> -- \n> Julian\n>\n>  ---\n> \"The National Association of Theater Concessionaires reported that in\n> 1986, 60% of all candy sold in movie theaters was sold to Roger  \n> Ebert.\"\n> \t\t-- D. Letterman\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}