{"thread":{"id":"14361","subject":"Merging a foreign tree into a bare repository.","startedAt":"2008-07-09T00:14:28Z","lastAt":"2008-07-09T21:04:22Z","messageCount":6,"participants":["Dave Quigley","Johannes Schindelin","Alejandro Riveira","Jakub Narebski","Eric Raible"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82657","messageId":"1215562468.4199.26.camel@moss-terrapins.epoch.ncsc.mil","threadId":"14361","inReplyTo":null,"subject":"Merging a foreign tree into a bare repository.","fromName":"Dave Quigley","fromEmail":"dpquigl@tycho.nsa.gov","sentAt":"2008-07-09T00:14:28Z","receivedAt":"2008-07-09T00:14:28Z","isPatch":false,"sender":{"key":"dpquigl@tycho.nsa.gov","avatar":null},"body":"Hello,\n   I created a bare copy of Linus' 2.6 kernel tree which I am using for\nsome public development. I have a branch in this tree called patchset\nwhich has a series of commits based on a patch set that I have. Now I\nwant to update this copy from the kernel.org git repository and rebase\nthe patches in the patchset branch. I typed git-fetch <URL to Linus'\ntree> and it successfully fetched the remote objects. I tried to then\nmerge them but you need a working directory to merge the changes which\nmakes sense. Normally if I had a working directory I would use\ngit-rebase to rebase my patches on a working tree but since this is a\nbare repository I can't do that. How would one go about doing this with\na bare repository? Is there a better way of doing this that I am not\naware of? Is my work flow completely off?\n\nDave\n"},{"id":"82659","messageId":"alpine.DEB.1.00.0807090238561.5277@eeepc-johanness","threadId":"14361","inReplyTo":"1215562468.4199.26.camel@moss-terrapins.epoch.ncsc.mil","subject":"Re: Merging a foreign tree into a bare repository.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-09T00:40:52Z","receivedAt":"2008-07-09T00:40:52Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 8 Jul 2008, Dave Quigley wrote:\n\n> I tried to then merge them but you need a working directory to merge the \n> changes which makes sense.\n\nOf course it does.  Merging runs the risk of conflicts, and you need a \nworking directory for that.\n\n> How would one go about doing this with a bare repository?\n\nVery easy: clone it (\"non-barely\"), merge, and push back the results.\n\nYou _need_ a working directory for the merge.\n\nHth,\nDscho \"who wonders what No Such Agency does with Git...\"\n"},{"id":"82730","messageId":"g52ho5$1eo$1@ger.gmane.org","threadId":"14361","inReplyTo":"alpine.DEB.1.00.0807090238561.5277@eeepc-johanness","subject":"Re: Merging a foreign tree into a bare repository.","fromName":"Alejandro Riveira","fromEmail":"ariveira@gmail.com","sentAt":"2008-07-09T14:25:10Z","receivedAt":"2008-07-09T14:25:10Z","isPatch":false,"sender":{"key":"ariveira@gmail.com","avatar":null},"body":"El Wed, 09 Jul 2008 02:40:52 +0200, Johannes Schindelin escribió:\n\n\n> \n> Hth,\n> Dscho \"who wonders what No Such Agency does with Git...\"\n\n SELinux development ?? :P\n"},{"id":"82734","messageId":"m3lk0bdkyl.fsf@localhost.localdomain","threadId":"14361","inReplyTo":"alpine.DEB.1.00.0807090238561.5277@eeepc-johanness","subject":"Re: Merging a foreign tree into a bare repository.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-07-09T17:27:15Z","receivedAt":"2008-07-09T17:27:15Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Tue, 8 Jul 2008, Dave Quigley wrote:\n> \n> > I tried to then merge them but you need a working directory to merge the \n> > changes which makes sense.\n> \n> Of course it does.  Merging runs the risk of conflicts, and you need a \n> working directory for that.\n> \n> > How would one go about doing this with a bare repository?\n> \n> Very easy: clone it (\"non-barely\"), merge, and push back the results.\n> \n> You _need_ a working directory for the merge.\n\nOr, alternatively, you can tell git where you want to have working\ndirectory with '--work-tree' parameter to git wrapper, for example\n\n  1451:jnareb@roke:/tmp/jnareb> git clone --bare test/ test-clone.git\n  Initialize test-clone.git\n  Initialized empty Git repository in /tmp/jnareb/test-clone.git/\n\n(Hmmm... I hope the last message, which is unnecessary and I think\nis just spillage from git-init, would vanish in builting git-clone)\n\n  1453:jnareb@roke:/tmp/jnareb/test-clone.git> ls\n  branches  config  description  HEAD  hooks  info  objects  refs\n  1454:jnareb@roke:/tmp/jnareb/test-clone.git> cat config \n  [core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = true\n\n(It is bare repository)\n  \n  1461:jnareb@roke:/tmp/jnareb/test-clone.git> git checkout\n  fatal: This operation must be run in a work tree\n\n(You would get the same error with merge and with rebase)\n\n  1458:jnareb@roke:/tmp/jnareb/test-clone.git> git --work-tree=../test-workdir/ checkout\n  1459:jnareb@roke:/tmp/jnareb/test-clone.git> ls ../test-workdir/\n  foo\n\nIt works!\n\nYou can also set core.worktree configuration variable... although\nI don't know what git would do if core.bare is true and core.worktree\nis set.\n\nHTH\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"82743","messageId":"alpine.DEB.1.00.0807092040360.4010@eeepc-johanness","threadId":"14361","inReplyTo":"m3lk0bdkyl.fsf@localhost.localdomain","subject":"Re: Merging a foreign tree into a bare repository.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-09T18:42:22Z","receivedAt":"2008-07-09T18:42:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Jul 2008, Jakub Narebski wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Tue, 8 Jul 2008, Dave Quigley wrote:\n> > \n> > > I tried to then merge them but you need a working directory to merge the \n> > > changes which makes sense.\n> > \n> > Of course it does.  Merging runs the risk of conflicts, and you need a \n> > working directory for that.\n> > \n> > > How would one go about doing this with a bare repository?\n> > \n> > Very easy: clone it (\"non-barely\"), merge, and push back the results.\n> > \n> > You _need_ a working directory for the merge.\n> \n> Or, alternatively, you can tell git where you want to have working\n> directory with '--work-tree' parameter to git wrapper,\n\n... which runs the risk of you forgetting to specify the same working \ndirectory all the time.\n\nWhich is the reason I did not suggest it.\n\n> You can also set core.worktree configuration variable...\n\n... effectively turning it into a non-bare repository.  Was that the \nquestion, how to turn a bare repository into a non-bare one?\n\nCiao,\nDscho\n"},{"id":"82750","messageId":"loom.20080709T205908-869@post.gmane.org","threadId":"14361","inReplyTo":"alpine.DEB.1.00.0807092040360.4010@eeepc-johanness","subject":"Re: Merging a foreign tree into a bare repository.","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2008-07-09T21:04:22Z","receivedAt":"2008-07-09T21:04:22Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin <at> gmx.de> writes:\n> \n> Hi,\n> \n> On Wed, 9 Jul 2008, Jakub Narebski wrote:\n> > \n> > Or, alternatively, you can tell git where you want to have working\n> > directory with '--work-tree' parameter to git wrapper,\n> \n> ... which runs the risk of you forgetting to specify the same working \n> directory all the time.\n> \n> Which is the reason I did not suggest it.\n\nHow about:\n\nGIT_WORK_TREE=<some-dir>; export GIT_WORK_TREE\n\nCombined with a PS1 which include an indication that GIT_WORK_TREE is set?\n\n- Eric\n"}]}