* Merging a foreign tree into a bare repository.
@ 2008-07-09 0:14 Dave Quigley
2008-07-09 0:40 ` Johannes Schindelin
0 siblings, 1 reply; 6+ messages in thread
From: Dave Quigley @ 2008-07-09 0:14 UTC (permalink / raw)
To: Git Mailing List
Hello,
I created a bare copy of Linus' 2.6 kernel tree which I am using for
some public development. I have a branch in this tree called patchset
which has a series of commits based on a patch set that I have. Now I
want to update this copy from the kernel.org git repository and rebase
the patches in the patchset branch. I typed git-fetch <URL to Linus'
tree> and it successfully fetched the remote objects. I tried to then
merge them but you need a working directory to merge the changes which
makes sense. Normally if I had a working directory I would use
git-rebase to rebase my patches on a working tree but since this is a
bare repository I can't do that. How would one go about doing this with
a bare repository? Is there a better way of doing this that I am not
aware of? Is my work flow completely off?
Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merging a foreign tree into a bare repository.
2008-07-09 0:14 Merging a foreign tree into a bare repository Dave Quigley
@ 2008-07-09 0:40 ` Johannes Schindelin
2008-07-09 14:25 ` Alejandro Riveira
2008-07-09 17:27 ` Jakub Narebski
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Schindelin @ 2008-07-09 0:40 UTC (permalink / raw)
To: Dave Quigley; +Cc: Git Mailing List
Hi,
On Tue, 8 Jul 2008, Dave Quigley wrote:
> I tried to then merge them but you need a working directory to merge the
> changes which makes sense.
Of course it does. Merging runs the risk of conflicts, and you need a
working directory for that.
> How would one go about doing this with a bare repository?
Very easy: clone it ("non-barely"), merge, and push back the results.
You _need_ a working directory for the merge.
Hth,
Dscho "who wonders what No Such Agency does with Git..."
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Merging a foreign tree into a bare repository.
2008-07-09 0:40 ` Johannes Schindelin
@ 2008-07-09 14:25 ` Alejandro Riveira
2008-07-09 17:27 ` Jakub Narebski
1 sibling, 0 replies; 6+ messages in thread
From: Alejandro Riveira @ 2008-07-09 14:25 UTC (permalink / raw)
To: git
El Wed, 09 Jul 2008 02:40:52 +0200, Johannes Schindelin escribió:
>
> Hth,
> Dscho "who wonders what No Such Agency does with Git..."
SELinux development ?? :P
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merging a foreign tree into a bare repository.
2008-07-09 0:40 ` Johannes Schindelin
2008-07-09 14:25 ` Alejandro Riveira
@ 2008-07-09 17:27 ` Jakub Narebski
2008-07-09 18:42 ` Johannes Schindelin
1 sibling, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2008-07-09 17:27 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Dave Quigley, Git Mailing List
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Tue, 8 Jul 2008, Dave Quigley wrote:
>
> > I tried to then merge them but you need a working directory to merge the
> > changes which makes sense.
>
> Of course it does. Merging runs the risk of conflicts, and you need a
> working directory for that.
>
> > How would one go about doing this with a bare repository?
>
> Very easy: clone it ("non-barely"), merge, and push back the results.
>
> You _need_ a working directory for the merge.
Or, alternatively, you can tell git where you want to have working
directory with '--work-tree' parameter to git wrapper, for example
1451:jnareb@roke:/tmp/jnareb> git clone --bare test/ test-clone.git
Initialize test-clone.git
Initialized empty Git repository in /tmp/jnareb/test-clone.git/
(Hmmm... I hope the last message, which is unnecessary and I think
is just spillage from git-init, would vanish in builting git-clone)
1453:jnareb@roke:/tmp/jnareb/test-clone.git> ls
branches config description HEAD hooks info objects refs
1454:jnareb@roke:/tmp/jnareb/test-clone.git> cat config
[core]
repositoryformatversion = 0
filemode = true
bare = true
(It is bare repository)
1461:jnareb@roke:/tmp/jnareb/test-clone.git> git checkout
fatal: This operation must be run in a work tree
(You would get the same error with merge and with rebase)
1458:jnareb@roke:/tmp/jnareb/test-clone.git> git --work-tree=../test-workdir/ checkout
1459:jnareb@roke:/tmp/jnareb/test-clone.git> ls ../test-workdir/
foo
It works!
You can also set core.worktree configuration variable... although
I don't know what git would do if core.bare is true and core.worktree
is set.
HTH
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Merging a foreign tree into a bare repository.
2008-07-09 17:27 ` Jakub Narebski
@ 2008-07-09 18:42 ` Johannes Schindelin
2008-07-09 21:04 ` Eric Raible
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2008-07-09 18:42 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Dave Quigley, Git Mailing List
Hi,
On Wed, 9 Jul 2008, Jakub Narebski wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > On Tue, 8 Jul 2008, Dave Quigley wrote:
> >
> > > I tried to then merge them but you need a working directory to merge the
> > > changes which makes sense.
> >
> > Of course it does. Merging runs the risk of conflicts, and you need a
> > working directory for that.
> >
> > > How would one go about doing this with a bare repository?
> >
> > Very easy: clone it ("non-barely"), merge, and push back the results.
> >
> > You _need_ a working directory for the merge.
>
> Or, alternatively, you can tell git where you want to have working
> directory with '--work-tree' parameter to git wrapper,
... which runs the risk of you forgetting to specify the same working
directory all the time.
Which is the reason I did not suggest it.
> You can also set core.worktree configuration variable...
... effectively turning it into a non-bare repository. Was that the
question, how to turn a bare repository into a non-bare one?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Merging a foreign tree into a bare repository.
2008-07-09 18:42 ` Johannes Schindelin
@ 2008-07-09 21:04 ` Eric Raible
0 siblings, 0 replies; 6+ messages in thread
From: Eric Raible @ 2008-07-09 21:04 UTC (permalink / raw)
To: git
Johannes Schindelin <Johannes.Schindelin <at> gmx.de> writes:
>
> Hi,
>
> On Wed, 9 Jul 2008, Jakub Narebski wrote:
> >
> > Or, alternatively, you can tell git where you want to have working
> > directory with '--work-tree' parameter to git wrapper,
>
> ... which runs the risk of you forgetting to specify the same working
> directory all the time.
>
> Which is the reason I did not suggest it.
How about:
GIT_WORK_TREE=<some-dir>; export GIT_WORK_TREE
Combined with a PS1 which include an indication that GIT_WORK_TREE is set?
- Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-07-09 21:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09 0:14 Merging a foreign tree into a bare repository Dave Quigley
2008-07-09 0:40 ` Johannes Schindelin
2008-07-09 14:25 ` Alejandro Riveira
2008-07-09 17:27 ` Jakub Narebski
2008-07-09 18:42 ` Johannes Schindelin
2008-07-09 21:04 ` Eric Raible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).