{"thread":{"id":"19569","subject":"Git Confusion","startedAt":"2009-05-29T07:43:35Z","lastAt":"2009-05-30T01:32:26Z","messageCount":10,"participants":["Paul Tarjan","Jeff King","Jakub Narebski","Avery Pennarun","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114987","messageId":"815c8c330905290043i4c99a753jd5ad9bdd4cf18bbc@mail.gmail.com","threadId":"19569","inReplyTo":null,"subject":"Git Confusion","fromName":"Paul Tarjan","fromEmail":"ptarjan@gmail.com","sentAt":"2009-05-29T07:43:35Z","receivedAt":"2009-05-29T07:43:35Z","isPatch":false,"sender":{"key":"ptarjan@gmail.com","avatar":null},"body":"Hi all,\n\nI'm new to git and probably doing something very dumb, but I can't\nseem to resolve this.\n\nI have a remote repository and a local one. I ssh to the remote\nmachine, goto the repository directory (not a bare repository), edit a\nfile and commit it. All if fine.\n\nI leave the remote host and go into the local git directory. Doing\n\"git pull origin master\" says \"Already up-to-date.\" but there is a\nfile I changed remotely, and I want to pull it locally!\n\nThe local repo was made with \"git clone http://example.com/.git\". I\nhave no branching (both are on master).\n\nMy way around this, is on the remote server, I do a \"git push other\nmaster\", and then on the local one I do \"git checkout HEAD file1\" for\neach file. Painful and I'm sure it is wrong.\n\nAny ideas? How do you debug this?\n\nThanks\nPaul\n"},{"id":"115008","messageId":"20090529125853.GB11785@sigill.intra.peff.net","threadId":"19569","inReplyTo":"815c8c330905290043i4c99a753jd5ad9bdd4cf18bbc@mail.gmail.com","subject":"Re: Git Confusion","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-29T12:58:53Z","receivedAt":"2009-05-29T12:58:53Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 29, 2009 at 12:43:35AM -0700, Paul Tarjan wrote:\n\n> I'm new to git and probably doing something very dumb, but I can't\n> seem to resolve this.\n> \n> I have a remote repository and a local one. I ssh to the remote\n> machine, goto the repository directory (not a bare repository), edit a\n> file and commit it. All if fine.\n> \n> I leave the remote host and go into the local git directory. Doing\n> \"git pull origin master\" says \"Already up-to-date.\" but there is a\n> file I changed remotely, and I want to pull it locally!\n> \n> The local repo was made with \"git clone http://example.com/.git\". I\n> have no branching (both are on master).\n\nYour repository is accessed over http.  You need to run \"git\nupdate-server-info\" to build the files for clients to see the actual\nupdates.\n\nUsually such a repo is bare, and gets updates only by push. In that\ncase, enabling the update hook to run update-server-info is sufficient.\nBut in your case, you are actually working on the remote repo via commit\nand other means, so there is no convenient way to always\nupdate-server-info after a change.\n\nIs there a particular reason you cloned over http instead of over ssh?\n\n-Peff\n"},{"id":"115011","messageId":"m3d49sauru.fsf@localhost.localdomain","threadId":"19569","inReplyTo":"20090529125853.GB11785@sigill.intra.peff.net","subject":"Re: Git Confusion","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-05-29T13:44:26Z","receivedAt":"2009-05-29T13:44:26Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jeff King <peff@peff.net> writes:\n> On Fri, May 29, 2009 at 12:43:35AM -0700, Paul Tarjan wrote:\n> \n> > I'm new to git and probably doing something very dumb, but I can't\n> > seem to resolve this.\n> > \n> > I have a remote repository and a local one. I ssh to the remote\n> > machine, goto the repository directory (not a bare repository), edit a\n> > file and commit it. All if fine.\n> > \n> > I leave the remote host and go into the local git directory. Doing\n> > \"git pull origin master\" says \"Already up-to-date.\" but there is a\n> > file I changed remotely, and I want to pull it locally!\n> > \n> > The local repo was made with \"git clone http://example.com/.git\". I\n> > have no branching (both are on master).\n> \n> Your repository is accessed over http.  You need to run \"git\n> update-server-info\" to build the files for clients to see the actual\n> updates.\n> \n> Usually such a repo is bare, and gets updates only by push. In that\n> case, enabling the update hook to run update-server-info is sufficient.\n> But in your case, you are actually working on the remote repo via commit\n> and other means, so there is no convenient way to always\n> update-server-info after a change.\n\nWell, he can always add git-update-server-info to post-commit hook.\n\n> \n> Is there a particular reason you cloned over http instead of over ssh?\n\nOr git protocol?\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"115012","messageId":"20090529135242.GA30926@coredump.intra.peff.net","threadId":"19569","inReplyTo":"m3d49sauru.fsf@localhost.localdomain","subject":"Re: Git Confusion","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-29T13:52:42Z","receivedAt":"2009-05-29T13:52:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 29, 2009 at 06:44:26AM -0700, Jakub Narebski wrote:\n\n> > Usually such a repo is bare, and gets updates only by push. In that\n> > case, enabling the update hook to run update-server-info is sufficient.\n> > But in your case, you are actually working on the remote repo via commit\n> > and other means, so there is no convenient way to always\n> > update-server-info after a change.\n> \n> Well, he can always add git-update-server-info to post-commit hook.\n\nThat covers committing, but what about reset, rebase, \"branch -f\", etc?\nI don't think there is a catch-all for all the ways that a repo can be\nupdated locally.\n\n> > Is there a particular reason you cloned over http instead of over ssh?\n> Or git protocol?\n\nYes, that would work fine, too. I mentioned ssh because he already\nindicated that he was able to ssh into the box (and may or may not have\nthe git daemon set up).\n\n-Peff\n"},{"id":"115044","messageId":"815c8c330905291324w4e861602n8278df72fdbc28db@mail.gmail.com","threadId":"19569","inReplyTo":"20090529135242.GA30926@coredump.intra.peff.net","subject":"Re: Git Confusion","fromName":"Paul Tarjan","fromEmail":"ptarjan@gmail.com","sentAt":"2009-05-29T20:24:59Z","receivedAt":"2009-05-29T20:24:59Z","isPatch":false,"sender":{"key":"ptarjan@gmail.com","avatar":null},"body":"Thank you very much. For skimmers the solution is :\n\ngit update-server-info\n\nevery time I do something to the remote repo.\n\nThe reason I need http is slightly convoluted. The remote machine is\nshared hosting with 1 ssh login that I don't want to give to my\npartner AND I don't have root on that box. And as you correctly\nguessed, that box doesn't have the git demon. The local machine where\nhe is doing his development. The only solution I saw without giving\nhim my username + pass to SSH was to do http cloning. Any better\nsolutions?\n\nThanks guys, a great first intro to the git community.\n\nPaul Tarjan\n\nOn Fri, May 29, 2009 at 6:52 AM, Jeff King <peff@peff.net> wrote:\n> On Fri, May 29, 2009 at 06:44:26AM -0700, Jakub Narebski wrote:\n>\n>> > Usually such a repo is bare, and gets updates only by push. In that\n>> > case, enabling the update hook to run update-server-info is sufficient.\n>> > But in your case, you are actually working on the remote repo via commit\n>> > and other means, so there is no convenient way to always\n>> > update-server-info after a change.\n>>\n>> Well, he can always add git-update-server-info to post-commit hook.\n>\n> That covers committing, but what about reset, rebase, \"branch -f\", etc?\n> I don't think there is a catch-all for all the ways that a repo can be\n> updated locally.\n>\n>> > Is there a particular reason you cloned over http instead of over ssh?\n>> Or git protocol?\n>\n> Yes, that would work fine, too. I mentioned ssh because he already\n> indicated that he was able to ssh into the box (and may or may not have\n> the git daemon set up).\n>\n> -Peff\n>\n"},{"id":"115045","messageId":"32541b130905291328wd17339n1a8d1f572099502d@mail.gmail.com","threadId":"19569","inReplyTo":"815c8c330905291324w4e861602n8278df72fdbc28db@mail.gmail.com","subject":"Re: Git Confusion","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-05-29T20:28:43Z","receivedAt":"2009-05-29T20:28:43Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Fri, May 29, 2009 at 4:24 PM, Paul Tarjan <ptarjan@gmail.com> wrote:\n> The reason I need http is slightly convoluted. The remote machine is\n> shared hosting with 1 ssh login that I don't want to give to my\n> partner AND I don't have root on that box. And as you correctly\n> guessed, that box doesn't have the git demon. The local machine where\n> he is doing his development. The only solution I saw without giving\n> him my username + pass to SSH was to do http cloning. Any better\n> solutions?\n\nIt dosen't have the git daemon, or it's not running the git daemon?\nYou can just run it yourself from your user account, and it's kind of\nweird that it wouldn't exist.  (You could build it or copy the binary\nfrom another machine, I suppose.)\n\nHave fun,\n\nAvery\n"},{"id":"115047","messageId":"20090529203854.GA14326@coredump.intra.peff.net","threadId":"19569","inReplyTo":"815c8c330905291324w4e861602n8278df72fdbc28db@mail.gmail.com","subject":"Re: Git Confusion","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-29T20:38:54Z","receivedAt":"2009-05-29T20:38:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 29, 2009 at 01:24:59PM -0700, Paul Tarjan wrote:\n\n> The reason I need http is slightly convoluted. The remote machine is\n> shared hosting with 1 ssh login that I don't want to give to my\n> partner AND I don't have root on that box. And as you correctly\n> guessed, that box doesn't have the git demon. The local machine where\n> he is doing his development. The only solution I saw without giving\n> him my username + pass to SSH was to do http cloning. Any better\n> solutions?\n\nYou can let him login via ssh key and restrict the actions of that key\njust to running git-upload-pack (which is what \"git clone\" and \"git\nfetch\" will invoke to clone or fetch commits). Something like:\n\n  command=\"git-upload-pack /path/to/repo\" ssh-rsa ...\n\nin your .ssh/authorized_keys file. Not that he still won't be able to\nactually push (which is maybe what you want).\n\nFor a more featureful solution (with permissions for pushing and pulling\nmultiple repos), I think gitosis will do what you want (but I have never\nused it personally).\n\n-Peff\n"},{"id":"115048","messageId":"200905292245.56702.jnareb@gmail.com","threadId":"19569","inReplyTo":"815c8c330905291324w4e861602n8278df72fdbc28db@mail.gmail.com","subject":"Re: Git Confusion","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-05-29T20:45:55Z","receivedAt":"2009-05-29T20:45:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 29 May 2009, Paul Tarjan wrote:\n> Thank you very much. For skimmers the solution is :\n> \n> git update-server-info\n> \n> every time I do something to the remote repo.\n> \n> The reason I need http is slightly convoluted. The remote machine is\n> shared hosting with 1 ssh login that I don't want to give to my\n> partner AND I don't have root on that box. And as you correctly\n> guessed, that box doesn't have the git demon. The local machine where\n> he is doing his development. The only solution I saw without giving\n> him my username + pass to SSH was to do http cloning. Any better\n> solutions?\n\nI see two possible solutions (and you can use both):\n\n1. Have separate publishing repository, which would be bare, and updated\n   only via push (so enabling 'update' / 'post-receive' hooks would be\n   enough for HTTP). This is good idea also because it makes it possible\n   to change commits (rewrite history), e.g. do \"git commit --amend\"...\n   provided that you didn't push part of history you are changing to\n   public repository. If you are worrying about disk space, you can\n   always set up alternates.\n\n2. Use Gitosis (or ssh_acl) to control access via SSH to repository\n   without need to provide extra user accounts, or use git-shell as\n   login shell for user accounts which are meant only to access\n   repositories. I think you can use Gitosis without being a root...\n   see link in BlogPosts page at Git Wiki.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"115060","messageId":"slrnh2105v.460.sitaramc@sitaramc.homelinux.net","threadId":"19569","inReplyTo":"20090529203854.GA14326@coredump.intra.peff.net","subject":"Re: Git Confusion","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-05-30T00:41:35Z","receivedAt":"2009-05-30T00:41:35Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-05-29 20:38:54, Jeff King <peff@peff.net> wrote:\n> On Fri, May 29, 2009 at 01:24:59PM -0700, Paul Tarjan wrote:\n>\n>> The reason I need http is slightly convoluted. The remote machine is\n>> shared hosting with 1 ssh login that I don't want to give to my\n>> partner AND I don't have root on that box.\n\n[snip]\n\n> You can let him login via ssh key and restrict the actions of that key\n> just to running git-upload-pack (which is what \"git clone\" and \"git\n> fetch\" will invoke to clone or fetch commits). Something like:\n>\n>   command=\"git-upload-pack /path/to/repo\" ssh-rsa ...\n>\n> in your .ssh/authorized_keys file. Not that he still won't be able to\n> actually push (which is maybe what you want).\n>\n> For a more featureful solution (with permissions for pushing and pulling\n> multiple repos), I think gitosis will do what you want (but I have never\n> used it personally).\n\ngitosis is indeed quite featureful.  I use it at work to\nadmin about 11 projects with between 1-6 devs and it works\nvery well.  All done with ssh pubkey and the \"command=\"\nfeature of .ssh/authorized_keys that Jeff mentioned above,\nwith a bit of python to read a conf file and decide who is\nallowed to read/write what repository etc.\n"},{"id":"115063","messageId":"slrnh21359.460.sitaramc@sitaramc.homelinux.net","threadId":"19569","inReplyTo":"200905292245.56702.jnareb@gmail.com","subject":"Re: Git Confusion","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-05-30T01:32:26Z","receivedAt":"2009-05-30T01:32:26Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-05-29 20:45:55, Jakub Narebski <jnareb@gmail.com> wrote:\n\n>    repositories. I think you can use Gitosis without being a root...\n\nyou don't need root for gitosis.  However, this means you\nwill be using your own \"regular work\" userid to host gitosis\nalso, which is a wee bit fiddly.\n\nApart from things like fixing up PYTHONPATH in advance,\nadding a \"--prefix=DIR\" to the install command, etc., you\nshould also remember that any pubkey added to gitosis\nbecomes a \"git only\" user, so normal ssh won't work for him\nanymore.  If your own access to the machine which is now\nyour gitosis server is via pubkey, you may find yourself\nlocked out -- don't add that pubkey to gitosis :-)\n\nIf the original poster needs more info, I will be happy to\ngive more details.\n"}]}