{"thread":{"id":"31415","subject":"Clone to an SSH destination","startedAt":"2012-09-03T10:21:43Z","lastAt":"2012-09-03T14:27:29Z","messageCount":10,"participants":["Mark Hills","Ævar Arnfjörð Bjarmason","Konstantin Khomoutov","Sitaram Chamarty","Enrico Weigelt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"198243","messageId":"alpine.LFD.2.01.1209031059480.4753@sys880.ldn.framestore.com","threadId":"31415","inReplyTo":null,"subject":"Clone to an SSH destination","fromName":"Mark Hills","fromEmail":"mark.hills@framestore.com","sentAt":"2012-09-03T10:21:43Z","receivedAt":"2012-09-03T10:21:43Z","isPatch":false,"sender":{"key":"mark.hills@framestore.com","avatar":null},"body":"How do I clone a repo _to_ a new repo over SSH? I tried:\n\n  cd xx\n  git clone --bare . gitserver:/scm/xx.git\n  git clone --bare . ssh://gitserver/scm/xx.git\n\nThis does not have the expected result, and instead a local path of the \ngiven name is created (eg. a 'gitserver:' directory)\n\nThis seems to be a FAQ, but the only answer I can find (Google) is to \nlogin to the server and create the repo, setup a remote and push to it.\n \nThis is quite cumbersome; we have a large team of devs who use a simple \n'git clone' to an NFS directory, but we wish to retire NFS access.\n\nIs there a technical limiation preventing clone-to-ssh, or just something \nwaiting to be implemented?\n\n(Please keep me CC'd; I am currently reading the web archives)\n\nMany thanks\n\n-- \nMark\n"},{"id":"198245","messageId":"CACBZZX7Pe5gsfpFTihE33a1Exia_4dbMQ9p_Xc_z4Ry=Et9KLA@mail.gmail.com","threadId":"31415","inReplyTo":"alpine.LFD.2.01.1209031059480.4753@sys880.ldn.framestore.com","subject":"Re: Clone to an SSH destination","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-09-03T11:26:42Z","receivedAt":"2012-09-03T11:26:42Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 3, 2012 at 12:21 PM, Mark Hills <Mark.Hills@framestore.com> wrote:\n> How do I clone a repo _to_ a new repo over SSH? I tried:\n>\n>   cd xx\n>   git clone --bare . gitserver:/scm/xx.git\n>   git clone --bare . ssh://gitserver/scm/xx.git\n>\n> This does not have the expected result, and instead a local path of the\n> given name is created (eg. a 'gitserver:' directory)\n>\n> This seems to be a FAQ, but the only answer I can find (Google) is to\n> login to the server and create the repo, setup a remote and push to it.\n\nBasically Git doesn't support this yet, mainly because it could only\nbe supported with the ssh or local transports.\n\nWith anything else it would break, so push can only assume that\nsomething on the other end can receive data, can update branch\npointers etc. Not create a brand new repository.\n\nYou could of course supply your devs with an alias that ssh's to that\nserver, does an init if needed, and then does a push.\n\n> This is quite cumbersome; we have a large team of devs who use a simple\n> 'git clone' to an NFS directory, but we wish to retire NFS access.\n>\n> Is there a technical limiation preventing clone-to-ssh, or just something\n> waiting to be implemented?\n\nBut I'm actually more curious about why you need this in the first\nplace, there's a bunch of devs where I work as well, but they never\nhave the need to create new repos on some NFS drive in this manner.\n\nWhat are your devs doing when they do clone their current working\ndirectory to some NFS location, maybe there's a better way to do it.\n"},{"id":"198246","messageId":"20120903154732.5fb50b173fa51db8300624b3@domain007.com","threadId":"31415","inReplyTo":"alpine.LFD.2.01.1209031059480.4753@sys880.ldn.framestore.com","subject":"Re: Clone to an SSH destination","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2012-09-03T11:47:32Z","receivedAt":"2012-09-03T11:47:32Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Mon, 3 Sep 2012 11:21:43 +0100 (BST)\nMark Hills <Mark.Hills@framestore.com> wrote:\n\n> How do I clone a repo _to_ a new repo over SSH? I tried:\n> \n>   cd xx\n>   git clone --bare . gitserver:/scm/xx.git\n>   git clone --bare . ssh://gitserver/scm/xx.git\n>\n> This does not have the expected result, and instead a local path of\n> the given name is created (eg. a 'gitserver:' directory)\n\nNo, `git clone` is intended to work with your local machine.\nAnd I can't really imagine how it would work in a way you want.\n\n> This seems to be a FAQ, but the only answer I can find (Google) is to \n> login to the server and create the repo, setup a remote and push to\n> it. \n> This is quite cumbersome; we have a large team of devs who use a\n> simple 'git clone' to an NFS directory, but we wish to retire NFS\n> access.\n> \n> Is there a technical limiation preventing clone-to-ssh, or just\n> something waiting to be implemented?\n\nI think this is more a conceptual issue: such a \"remote cloning\" would\nmean *creation* of a repository as part of the process.  I'm not aware\nof any [D]VCS system which would routinely allow such a thing: usually\nthe creation of a repository is an \"administrative\" act, which is\ndistinct from regular (push/fetch) access to that repository.\n\ngitolite kind of implements this (\"wild repos\") [1], you could look if\nit suits your needs.\n\nNow back to your problem.\n\nIf you have NFS access, you can probably do proper cloning using NFS:\n1) Export via NFS the directory in which you want your resulting\n   bare repository located.\n2) Do simple *local* clone (using paths accessed by NFS):\n   git clone --bare /path/to/source/repo /path/to/destination/repo\n3) Do certain fixups in the destination repo, if needed, then\n   access it normally via SSH (or whatever protocol you prefer).\n\nIf you don't want to do this, then revert to a normal two-step\nprocedure:\n1) Log into the server, create a repo by hand:\n   git init --bare /path/to/repo\n2) Push everything relevant from a source repo there:\n   cd /path/to/local/repo\n   git remote add origin ssh://gitserver/scm/xx.git\n   git push origin refs/*:refs/*\n\nStep (1) may depends on what server-side solution your need; for\ninstance, in gitolite you would be configuring a new repo in the\nconfiguration file in your local clone of the gitolite admin repo and\npushing your changes to the server.\n\n1. http://sitaramc.github.com/gitolite/wild.html\n"},{"id":"198247","messageId":"CAMK1S_iSbDNc39XjWZLgUJuBg71+A+CHbEq09QG+mntDQrdNxw@mail.gmail.com","threadId":"31415","inReplyTo":"20120903154732.5fb50b173fa51db8300624b3@domain007.com","subject":"Re: Clone to an SSH destination","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-09-03T12:54:59Z","receivedAt":"2012-09-03T12:54:59Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Mon, Sep 3, 2012 at 5:17 PM, Konstantin Khomoutov\n<flatworm@users.sourceforge.net> wrote:\n> On Mon, 3 Sep 2012 11:21:43 +0100 (BST)\n> Mark Hills <Mark.Hills@framestore.com> wrote:\n\n[snip]\n\n>> This is quite cumbersome; we have a large team of devs who use a\n>> simple 'git clone' to an NFS directory, but we wish to retire NFS\n>> access.\n\n[snip]\n\n> gitolite kind of implements this (\"wild repos\") [1], you could look if\n> it suits your needs.\n\nThe simplest conf to do what you want in gitolite is something like this:\n\n    repo [a-zA-Z0-9]..*\n        C   =   @all\n        RW+ =   @all\n\nBut of course your *user* authentication will probably change quite a\nbit, since gitolite runs as one Unix user and merely simulates many\n\"gitolite users\", while in the NFS method each of your devs probably\nhas a full login to the server.\n"},{"id":"198248","messageId":"alpine.LFD.2.01.1209031351200.5945@sys880.ldn.framestore.com","threadId":"31415","inReplyTo":"CACBZZX7Pe5gsfpFTihE33a1Exia_4dbMQ9p_Xc_z4Ry=Et9KLA@mail.gmail.com","subject":"Re: Clone to an SSH destination","fromName":"Mark Hills","fromEmail":"mark.hills@framestore.com","sentAt":"2012-09-03T13:07:48Z","receivedAt":"2012-09-03T13:07:48Z","isPatch":false,"sender":{"key":"mark.hills@framestore.com","avatar":null},"body":"On Mon, 3 Sep 2012, Ævar Arnfjörð Bjarmason wrote:\n\n> On Mon, Sep 3, 2012 at 12:21 PM, Mark Hills <Mark.Hills@framestore.com> wrote:\n> > How do I clone a repo _to_ a new repo over SSH? I tried:\n> >\n> >   cd xx\n> >   git clone --bare . gitserver:/scm/xx.git\n> >   git clone --bare . ssh://gitserver/scm/xx.git\n> >\n> > This does not have the expected result, and instead a local path of the\n> > given name is created (eg. a 'gitserver:' directory)\n> >\n> > This seems to be a FAQ, but the only answer I can find (Google) is to\n> > login to the server and create the repo, setup a remote and push to it.\n> \n> Basically Git doesn't support this yet, mainly because it could only\n> be supported with the ssh or local transports.\n> \n> With anything else it would break, so push can only assume that\n> something on the other end can receive data, can update branch\n> pointers etc. Not create a brand new repository.\n> \n> You could of course supply your devs with an alias that ssh's to that\n> server, does an init if needed, and then does a push.\n\nYes, a last resort, but do-able of course.\n\n> > This is quite cumbersome; we have a large team of devs who use a simple\n> > 'git clone' to an NFS directory, but we wish to retire NFS access.\n> >\n> > Is there a technical limiation preventing clone-to-ssh, or just something\n> > waiting to be implemented?\n> \n> But I'm actually more curious about why you need this in the first\n> place, there's a bunch of devs where I work as well, but they never\n> have the need to create new repos on some NFS drive in this manner.\n\nWithout a command-line onto the filesystem (either local or NFS), how do \nyou create a new repository for a new project?\n\nWe have a fairly large team on a diverse set of projects. Projects come \nand go, so it's a burden if the administrator is needed just to create \nrepos.\n\nLikewise, it's a step backwards for the developer to need to login \nthemselves over SSH -- whereas 'git clone' is so easy to NFS.\n\n> What are your devs doing when they do clone their current working \n> directory to some NFS location, maybe there's a better way to do it.\n\nMost projects start as a small test at some point; eg.\n\n  mkdir xx\n  cd xx\n  git init\n  <write some code>\n  git commit\n  ...\n\nWhen a project becomes more official, the developer clones to a central \nlocation; eg.\n\n  git clone --bare . /net/git/xx.git\n\nThis is the step that is inconvenient if only SSH access is available.\n\nThanks for your reply,\n\n-- \nMark"},{"id":"198249","messageId":"alpine.LFD.2.01.1209031410450.5945@sys880.ldn.framestore.com","threadId":"31415","inReplyTo":"CAMK1S_iSbDNc39XjWZLgUJuBg71+A+CHbEq09QG+mntDQrdNxw@mail.gmail.com","subject":"Re: Clone to an SSH destination","fromName":"Mark Hills","fromEmail":"mark.hills@framestore.com","sentAt":"2012-09-03T13:15:27Z","receivedAt":"2012-09-03T13:15:27Z","isPatch":false,"sender":{"key":"mark.hills@framestore.com","avatar":null},"body":"On Mon, 3 Sep 2012, Sitaram Chamarty wrote:\n\n> On Mon, Sep 3, 2012 at 5:17 PM, Konstantin Khomoutov\n> <flatworm@users.sourceforge.net> wrote:\n> > On Mon, 3 Sep 2012 11:21:43 +0100 (BST)\n> > Mark Hills <Mark.Hills@framestore.com> wrote:\n> \n> [snip]\n> \n> >> This is quite cumbersome; we have a large team of devs who use a\n> >> simple 'git clone' to an NFS directory, but we wish to retire NFS\n> >> access.\n> \n> [snip]\n> \n> > gitolite kind of implements this (\"wild repos\") [1], you could look if\n> > it suits your needs.\n> \n> The simplest conf to do what you want in gitolite is something like this:\n> \n>     repo [a-zA-Z0-9]..*\n>         C   =   @all\n>         RW+ =   @all\n> \n> But of course your *user* authentication will probably change quite a\n> bit, since gitolite runs as one Unix user and merely simulates many\n> \"gitolite users\", while in the NFS method each of your devs probably\n> has a full login to the server.\n\nI'll check out gitolite, thanks.\n\nWe use unix users extensively (groups, permissions etc.) with YP, and this \nworks well; a separate permissions scheme is not very desireable.\n\nThe ssh method works very well right now, and nicely transparent. It's \nonly the initial clone/creation that is harder than it was over NFS. And \nit prevents the use of git-shell too.\n\nThanks\n\n-- \nMark\n"},{"id":"198251","messageId":"CAMK1S_hZ5C_dr+0-QPavnfjsCqeHFgd+qz3AL++E=wMZ-mf7Zw@mail.gmail.com","threadId":"31415","inReplyTo":"alpine.LFD.2.01.1209031410450.5945@sys880.ldn.framestore.com","subject":"Re: Clone to an SSH destination","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-09-03T13:48:59Z","receivedAt":"2012-09-03T13:48:59Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Mon, Sep 3, 2012 at 6:45 PM, Mark Hills <Mark.Hills@framestore.com> wrote:\n> On Mon, 3 Sep 2012, Sitaram Chamarty wrote:\n>\n>> On Mon, Sep 3, 2012 at 5:17 PM, Konstantin Khomoutov\n>> <flatworm@users.sourceforge.net> wrote:\n>> > On Mon, 3 Sep 2012 11:21:43 +0100 (BST)\n>> > Mark Hills <Mark.Hills@framestore.com> wrote:\n>>\n>> [snip]\n>>\n>> >> This is quite cumbersome; we have a large team of devs who use a\n>> >> simple 'git clone' to an NFS directory, but we wish to retire NFS\n>> >> access.\n>>\n>> [snip]\n>>\n>> > gitolite kind of implements this (\"wild repos\") [1], you could look if\n>> > it suits your needs.\n>>\n>> The simplest conf to do what you want in gitolite is something like this:\n>>\n>>     repo [a-zA-Z0-9]..*\n>>         C   =   @all\n>>         RW+ =   @all\n>>\n>> But of course your *user* authentication will probably change quite a\n>> bit, since gitolite runs as one Unix user and merely simulates many\n>> \"gitolite users\", while in the NFS method each of your devs probably\n>> has a full login to the server.\n>\n> I'll check out gitolite, thanks.\n>\n> We use unix users extensively (groups, permissions etc.) with YP, and this\n> works well; a separate permissions scheme is not very desireable.\n> The ssh method works very well right now, and nicely transparent. It's\n> only the initial clone/creation that is harder than it was over NFS. And\n> it prevents the use of git-shell too.\n\nIf I had to do this, and didn't want to use gitolite or something like\nit, I'd just make a script that will create the repo using an ssh call\nthen do a 'git push --mirror' to it.\n\nCall it \"git-new\" or something and train people to use that instead of\n\"clone\" when the repo doesn't even exist yet.\n\nBound to be easier than the administrative hassle you spoke of in your\nother email...\n"},{"id":"198254","messageId":"20120903180832.f6e9fc03a450011ea2b22737@domain007.com","threadId":"31415","inReplyTo":"alpine.LFD.2.01.1209031351200.5945@sys880.ldn.framestore.com","subject":"Re: Clone to an SSH destination","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2012-09-03T14:08:32Z","receivedAt":"2012-09-03T14:08:32Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Mon, 3 Sep 2012 14:07:48 +0100 (BST)\nMark Hills <Mark.Hills@framestore.com> wrote:\n\n[...]\n> > But I'm actually more curious about why you need this in the first\n> > place, there's a bunch of devs where I work as well, but they never\n> > have the need to create new repos on some NFS drive in this manner.\n> \n> Without a command-line onto the filesystem (either local or NFS), how\n> do you create a new repository for a new project?\n> \n> We have a fairly large team on a diverse set of projects. Projects\n> come and go, so it's a burden if the administrator is needed just to\n> create repos.\n> \n> Likewise, it's a step backwards for the developer to need to login \n> themselves over SSH -- whereas 'git clone' is so easy to NFS.\n> \n> > What are your devs doing when they do clone their current working \n> > directory to some NFS location, maybe there's a better way to do it.\n> \n> Most projects start as a small test at some point; eg.\n> \n>   mkdir xx\n>   cd xx\n>   git init\n>   <write some code>\n>   git commit\n>   ...\n> \n> When a project becomes more official, the developer clones to a\n> central location; eg.\n> \n>   git clone --bare . /net/git/xx.git\n> \n> This is the step that is inconvenient if only SSH access is available.\n\nWell, then it looks you want something like github.\nIn this case look at some more integrated solution such as Gitlab [1]\n-- I did not try it, but it looks like you import your users there and\nthen they can log in, add their SSH keys and create their projects.\n\nI also think gitolite has some way to actually use regular SSH users\n(or even users coming from a web server which is a front-end for Smart\nHTTP Git transport, doing its own authentication).  This is explained\nin [2], and I hope Sitaram could provide more insight on setting things\nup this way, if needed  (I did not use this feature).\n\n1. http://gitlabhq.com/\n2. http://sitaramc.github.com/gitolite/g2/auth.html\n"},{"id":"198255","messageId":"CAMK1S_jL-U_U8BcEaiTqgy3Z+KvsvmfUoz8GkCkDjQJafgY_zw@mail.gmail.com","threadId":"31415","inReplyTo":"20120903180832.f6e9fc03a450011ea2b22737@domain007.com","subject":"Re: Clone to an SSH destination","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-09-03T14:26:53Z","receivedAt":"2012-09-03T14:26:53Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Mon, Sep 3, 2012 at 7:38 PM, Konstantin Khomoutov\n<flatworm@users.sourceforge.net> wrote:\n> On Mon, 3 Sep 2012 14:07:48 +0100 (BST)\n> Mark Hills <Mark.Hills@framestore.com> wrote:\n>\n> [...]\n>> > But I'm actually more curious about why you need this in the first\n>> > place, there's a bunch of devs where I work as well, but they never\n>> > have the need to create new repos on some NFS drive in this manner.\n>>\n>> Without a command-line onto the filesystem (either local or NFS), how\n>> do you create a new repository for a new project?\n>>\n>> We have a fairly large team on a diverse set of projects. Projects\n>> come and go, so it's a burden if the administrator is needed just to\n>> create repos.\n>>\n>> Likewise, it's a step backwards for the developer to need to login\n>> themselves over SSH -- whereas 'git clone' is so easy to NFS.\n>>\n>> > What are your devs doing when they do clone their current working\n>> > directory to some NFS location, maybe there's a better way to do it.\n>>\n>> Most projects start as a small test at some point; eg.\n>>\n>>   mkdir xx\n>>   cd xx\n>>   git init\n>>   <write some code>\n>>   git commit\n>>   ...\n>>\n>> When a project becomes more official, the developer clones to a\n>> central location; eg.\n>>\n>>   git clone --bare . /net/git/xx.git\n>>\n>> This is the step that is inconvenient if only SSH access is available.\n>\n> Well, then it looks you want something like github.\n> In this case look at some more integrated solution such as Gitlab [1]\n> -- I did not try it, but it looks like you import your users there and\n> then they can log in, add their SSH keys and create their projects.\n\nAnything web based would be even more overhead than a simple:\n\n    ssh server git init --bare foo/bar.git && git push --mirror\nssh://git/~/foo/bar.git\n\nGitolite of course is even closer, as we discussed earlier.\n\n> I also think gitolite has some way to actually use regular SSH users\n> (or even users coming from a web server which is a front-end for Smart\n> HTTP Git transport, doing its own authentication).  This is explained\n> in [2], and I hope Sitaram could provide more insight on setting things\n> up this way, if needed  (I did not use this feature).\n\nAs I said earlier, regardless of how he does it, authentication will\nchange, since he is no longer using a local (well, locally mounted)\nfile system as the \"server\".  That may be \"get everyone to send us a\npub key\" or \"give everyone an http password and use smart http\".\n\nIn addition, if they choose smart http, they *have to* use gitolite.\nUnlike ssh, where that two command sequence above would do it all for\nthem, there is no eqvt if your git server is behind http.\n\n>\n> 1. http://gitlabhq.com/\n> 2. http://sitaramc.github.com/gitolite/g2/auth.html\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\n\n\n-- \nSitaram\n"},{"id":"198256","messageId":"a39bec83-ea05-462d-9b62-f01d4246ffc1@zcs","threadId":"31415","inReplyTo":"alpine.LFD.2.01.1209031351200.5945@sys880.ldn.framestore.com","subject":"Re: Clone to an SSH destination","fromName":"Enrico Weigelt","fromEmail":"enrico.weigelt@vnc.biz","sentAt":"2012-09-03T14:27:29Z","receivedAt":"2012-09-03T14:27:29Z","isPatch":false,"sender":{"key":"enrico.weigelt@vnc.biz","avatar":"https://gravatar.com/avatar/15479654ea5be5109582e0713a8ab4bb258846099c516dd320dc686ef70a8a3e?d=mp&s=160"},"body":"Hi,\n\n> Without a command-line onto the filesystem (either local or NFS), how\n> do you create a new repository for a new project?\n\nThese things are out of the scope of git itself, they belong to another\nlayer - you're probably looking for some repo hosting solution.\n\nOne already was mentioned: gitolite. Another one is gitosis.\n\n> We have a fairly large team on a diverse set of projects. Projects\n> come and go, so it's a burden if the administrator is needed just to\n> create repos.\n\nMaybe you'd also like to have some project management / ticketing\ntool. We've got an redmine and gitolite based solution for that,\nthat's automatically creating repos and managing access control\non per-project basis. Will be publically released in a few days,\njust drop a note if you're interested in it.\n\n> Most projects start as a small test at some point; eg.\n> \n>   mkdir xx\n>   cd xx\n>   git init\n>   <write some code>\n>   git commit\n>   ...\n> \n> When a project becomes more official, the developer clones to a\n> central\n> location; eg.\n> \n>   git clone --bare . /net/git/xx.git\n\nDo you have any kind of access control in place, or can everybody\nwrite just everywhere ?\n\n\ncu\n-- \nMit freundlichen Grüßen / Kind regards \n\nEnrico Weigelt \nVNC - Virtual Network Consult GmbH \nHead Of Development \n\nPariser Platz 4a, D-10117 Berlin\nTel.: +49 (30) 3464615-20\nFax: +49 (30) 3464615-59\n\nenrico.weigelt@vnc.biz; www.vnc.de \n"}]}