{"thread":{"id":"22161","subject":"Unable to get \"pretty\" URL aliases working","startedAt":"2010-01-11T05:57:09Z","lastAt":"2010-01-14T00:45:59Z","messageCount":6,"participants":["Adam Nielsen","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"131257","messageId":"4B4ABDB5.9000203@uq.edu.au","threadId":"22161","inReplyTo":null,"subject":"Unable to get \"pretty\" URL aliases working","fromName":"Adam Nielsen","fromEmail":"adam.nielsen@uq.edu.au","sentAt":"2010-01-11T05:57:09Z","receivedAt":"2010-01-11T05:57:09Z","isPatch":false,"sender":{"key":"adam.nielsen@uq.edu.au","avatar":"https://gravatar.com/avatar/f5ed2feee93ef40d640c5a4e43fcb9ac9a916e289d65d9614e1742089e73fb62?d=mp&s=160"},"body":"Hi all,\n\nI'm attemping to learn Git but I've gotten stuck trying to configure a \nserver to host my repositories.\n\nI would like to be able to do this:\n\n   git clone ssh://myserver/project.git\n   git push\n\nAnd have it work, but I keep getting errors about \"/project.git\" not \nexisting in the root directory of my server.  (Which is correct, they \nare stored elsewhere.)\n\nThe only documentation I could find about mapping a deep path to a \n\"pretty\" URL like this was in git-push(1) which stated I should add \nsomething like the following to a \"config file\".  I'm guessing it means \n/etc/gitconfig on the server.\n\n[url \"ssh://myserver/path/to/repos/\"]\n   insteadOf myserver:\n\nI'm a bit confused about where the colon comes into it, if I use that on \nthe command line I get errors about resolving domain names.  I've tried \nmany variations of the insteadOf line (\"ssh://myserver/\", \"myserver:/\", \n\"myserver/\" etc.) but none of them make any difference.  I don't even \nknow if this file is being used.\n\nAny pointers about how this URL mapping can be set up?\n\nMany thanks,\nAdam.\n\n(Please CC)\n"},{"id":"131263","messageId":"4B4AD73E.6090302@viscovery.net","threadId":"22161","inReplyTo":"4B4ABDB5.9000203@uq.edu.au","subject":"Re: Unable to get \"pretty\" URL aliases working","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-01-11T07:46:06Z","receivedAt":"2010-01-11T07:46:06Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Adam Nielsen schrieb:\n> I would like to be able to do this:\n> \n>   git clone ssh://myserver/project.git\n>   git push\n> \n> And have it work, but I keep getting errors about \"/project.git\" not\n> existing in the root directory of my server.  (Which is correct, they\n> are stored elsewhere.)\n\nThis form of URL can only accept the absolute path to project.git on\nmyserver, eg.:\n\n   ssh://myserver/home/adam/project.git\n\n-- Hannes\n"},{"id":"131265","messageId":"7v7hrpvzqa.fsf@alter.siamese.dyndns.org","threadId":"22161","inReplyTo":"4B4ABDB5.9000203@uq.edu.au","subject":"Re: Unable to get \"pretty\" URL aliases working","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-11T07:59:25Z","receivedAt":"2010-01-11T07:59:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adam Nielsen <adam.nielsen@uq.edu.au> writes:\n\n> I'm attemping to learn Git but I've gotten stuck trying to configure a\n> server to host my repositories.\n> ...\n> [url \"ssh://myserver/path/to/repos/\"]\n>   insteadOf myserver:\n\nurl.*.insteadOf is a configuration done on the _client_, i.e. the one that\nyou run \"git clone\", \"git fetch\", \"git push\", etc. on. \n\n\t$ cat >>$HOME/.gitconfig <<\\EOF\n        [url \"ssh://myserver/path/to/repos/\"]\n        \tinsteadOf = myserver://\n\tEOF\n        $ git clone myserver://project.git\n\nIn any case, \"attempting to learn Git\" doesn't mix well with use of\n\"insteadOf\" to me.  If you know /path/to/repos/project.git is what you\nwant to access, any \"attempting to learn Git\" person would do more\nstraight-forward \"git clone ssh://myserver/path/to/repos/project.git\", or\n\"git clone myserver:/path/to/repos/project.git\" which is even better (it\nis shorter to type and is a more natural form to spell ssh transport).\n\n;-)\n"},{"id":"131331","messageId":"4B4BB2DC.4090203@uq.edu.au","threadId":"22161","inReplyTo":"7v7hrpvzqa.fsf@alter.siamese.dyndns.org","subject":"Re: Unable to get \"pretty\" URL aliases working","fromName":"Adam Nielsen","fromEmail":"adam.nielsen@uq.edu.au","sentAt":"2010-01-11T23:23:08Z","receivedAt":"2010-01-11T23:23:08Z","isPatch":false,"sender":{"key":"adam.nielsen@uq.edu.au","avatar":"https://gravatar.com/avatar/f5ed2feee93ef40d640c5a4e43fcb9ac9a916e289d65d9614e1742089e73fb62?d=mp&s=160"},"body":"Hi all,\n\nThanks for the replies!\n\n> In any case, \"attempting to learn Git\" doesn't mix well with use of\n> \"insteadOf\" to me.  If you know /path/to/repos/project.git is what you\n> want to access, any \"attempting to learn Git\" person would do more\n> straight-forward \"git clone ssh://myserver/path/to/repos/project.git\", or\n> \"git clone myserver:/path/to/repos/project.git\" which is even better (it\n> is shorter to type and is a more natural form to spell ssh transport).\n\nJumping in the deep end is a valid method of learning :-)  Does that \nmean anyone using my repositories really needs to know exactly where on \nthe server I choose to keep them?  Something like \"git clone \nmyserver:/mnt/raid/nightly-backedup/public/repositories/git/project.git\" \nisn't particularly friendly.  (It's something that bugs me with NFS as \nwell.)  What happens if I want to move the repositories to another area \non the server?  Do all users have to update their local copies with a \nnew origin address?\n\nIs there any hacky way that this could be made to work?  I guess I could \nsymlink my repository directory to /git, then myserver:/git/project.git \nmight work.\n\nWhat actually happens when you use the ssh:// style connection? \ngit-daemon has a --base-path option which solves this issue for git:// \nURLs, so do ssh:// URLs not use the git protocol at all?  What is \ngit+ssh://?  Does that SSH to the machine and then connect to git-daemon \nvia localhost?  Because that would presumably make use of --base-path.\n\nThanks again,\nAdam.\n"},{"id":"131426","messageId":"7vockytrwy.fsf@alter.siamese.dyndns.org","threadId":"22161","inReplyTo":"4B4BB2DC.4090203@uq.edu.au","subject":"Re: Unable to get \"pretty\" URL aliases working","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-13T06:55:41Z","receivedAt":"2010-01-13T06:55:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adam Nielsen <adam.nielsen@uq.edu.au> writes:\n\n> What actually happens when you use the ssh:// style connection?\n\nBe it ssh://host/full/path or host:/full/path or host:path/in/home, you\nlog in as whatver ssh identifies you as to the server, and start a\nserver-side git process over there.\n\nWith ssh://host/path notation, there is no way to specify any relative\npath (i.e. \"/path\" part begins at root) so it will mean the same thing for\neverybody (unless you are getting chrooted or something), while host:path\nnotation allows relative path which will be taken relative as where you\nare, i.e. home directory of the user on the server.\n"},{"id":"131558","messageId":"4B4E6947.2020009@uq.edu.au","threadId":"22161","inReplyTo":"7vockytrwy.fsf@alter.siamese.dyndns.org","subject":"Re: Unable to get \"pretty\" URL aliases working","fromName":"Adam Nielsen","fromEmail":"adam.nielsen@uq.edu.au","sentAt":"2010-01-14T00:45:59Z","receivedAt":"2010-01-14T00:45:59Z","isPatch":false,"sender":{"key":"adam.nielsen@uq.edu.au","avatar":"https://gravatar.com/avatar/f5ed2feee93ef40d640c5a4e43fcb9ac9a916e289d65d9614e1742089e73fb62?d=mp&s=160"},"body":">> What actually happens when you use the ssh:// style connection?\n> \n> Be it ssh://host/full/path or host:/full/path or host:path/in/home, you\n> log in as whatver ssh identifies you as to the server, and start a\n> server-side git process over there.\n\nAh ok, that makes more sense.  Strange then if it's a server-side git \nprocess that it ignores the server's /etc/gitconfig where aliases can be \nset up.\n\n> With ssh://host/path notation, there is no way to specify any relative\n> path (i.e. \"/path\" part begins at root) so it will mean the same thing for\n> everybody (unless you are getting chrooted or something), while host:path\n> notation allows relative path which will be taken relative as where you\n> are, i.e. home directory of the user on the server.\n\nIn that case I symlinked my repository folder to /git so that SSH users \ncan \"cd /git/project.git\" and this seems to work well.  I can now use \ngit URLs like ssh://server/git/project.git even though the repos are \nburied much deeper down in the tree.\n\nThanks for the explanations!\n\nCheers,\nAdam.\n"}]}