Git development
 help / color / mirror / Atom feed
* Exporting a tree from a repository
@ 2007-07-14 20:25 Ciprian Dorin Craciun
  2007-07-14 21:46 ` Julian Phillips
  2007-07-15  7:17 ` martin f krafft
  0 siblings, 2 replies; 6+ messages in thread
From: Ciprian Dorin Craciun @ 2007-07-14 20:25 UTC (permalink / raw)
  To: git

    Hello all!

    I am a new GIT user, I like it, so I started playing with it for
different projects I work on.

    Currently I am playing with "Linux from Scratch", and I have
written some scripts to automatize the build process -- kind of
install scripts...

    For this I use GIT to store all the source packages -- each inside
it's own branch :).

    My question is the following: How can I export an entire tree
without using a working directory, or cloning the repository. (Because
from what I have seen so far there is no way to use the same
repository with many working directories...)

    Now I know that I can use "git archive | tar -x"... I am looking
for the same functionality but without the intermediary file... Maybe
something like "git archive --format=tree <branch>"...

    Also there is also a possible drawback by using git archive with
tar format, that is if I decide to make the repository available to
the public then it would be nice to have this export functionality...
I think this could be also used for kernel sources as an alternative
to downloading the tar.bz2 file or copying the entire tree...

    Thank you all for your feedback!
    Ciprian Craciun.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exporting a tree from a repository
  2007-07-14 20:25 Exporting a tree from a repository Ciprian Dorin Craciun
@ 2007-07-14 21:46 ` Julian Phillips
  2007-07-15  6:12   ` Junio C Hamano
  2007-07-15  7:12   ` Ciprian Dorin Craciun
  2007-07-15  7:17 ` martin f krafft
  1 sibling, 2 replies; 6+ messages in thread
From: Julian Phillips @ 2007-07-14 21:46 UTC (permalink / raw)
  To: Ciprian Dorin Craciun; +Cc: git

On Sat, 14 Jul 2007, Ciprian Dorin Craciun wrote:

>   Hello all!
>
>   I am a new GIT user, I like it, so I started playing with it for
> different projects I work on.
>
>   Currently I am playing with "Linux from Scratch", and I have
> written some scripts to automatize the build process -- kind of
> install scripts...
>
>   For this I use GIT to store all the source packages -- each inside
> it's own branch :).
>
>   My question is the following: How can I export an entire tree
> without using a working directory, or cloning the repository. (Because
> from what I have seen so far there is no way to use the same
> repository with many working directories...)

You can have as many working directories as you want from one repository 
using the git-new-workdir script from contrib/workdir.  You do need to be 
careful when updating references though (you basically want to avoid 
updating a reference that you are using in another working directory).

You should also be able to use this to get an "export" - simply create the 
new workdir and then remove the .git (being careful not to accidentally do 
this in your actual repository).  However I expect there is a better way 
to do this ...

-- 
Julian

  ---
Quark!  Quark!  Beware the quantum duck!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exporting a tree from a repository
  2007-07-14 21:46 ` Julian Phillips
@ 2007-07-15  6:12   ` Junio C Hamano
  2007-07-15  7:12   ` Ciprian Dorin Craciun
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-07-15  6:12 UTC (permalink / raw)
  To: Julian Phillips; +Cc: Ciprian Dorin Craciun, git

Julian Phillips <julian@quantumfyre.co.uk> writes:

> You should also be able to use this to get an "export" - simply create
> the new workdir and then remove the .git (being careful not to
> accidentally do this in your actual repository).  However I expect
> there is a better way to do this ...

You meant "git-archive" perhaps.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exporting a tree from a repository
  2007-07-14 21:46 ` Julian Phillips
  2007-07-15  6:12   ` Junio C Hamano
@ 2007-07-15  7:12   ` Ciprian Dorin Craciun
  2007-07-15  9:15     ` Alex Riesen
  1 sibling, 1 reply; 6+ messages in thread
From: Ciprian Dorin Craciun @ 2007-07-15  7:12 UTC (permalink / raw)
  To: Julian Phillips, Junio C Hamano; +Cc: git

On 7/15/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:
> On Sat, 14 Jul 2007, Ciprian Dorin Craciun wrote:
>
> >   Hello all!
> >
> >   I am a new GIT user, I like it, so I started playing with it for
> > different projects I work on.
> >
> >   Currently I am playing with "Linux from Scratch", and I have
> > written some scripts to automatize the build process -- kind of
> > install scripts...
> >
> >   For this I use GIT to store all the source packages -- each inside
> > it's own branch :).
> >
> >   My question is the following: How can I export an entire tree
> > without using a working directory, or cloning the repository. (Because
> > from what I have seen so far there is no way to use the same
> > repository with many working directories...)
>
> You can have as many working directories as you want from one repository
> using the git-new-workdir script from contrib/workdir.  You do need to be
> careful when updating references though (you basically want to avoid
> updating a reference that you are using in another working directory).
>
> You should also be able to use this to get an "export" - simply create the
> new workdir and then remove the .git (being careful not to accidentally do
> this in your actual repository).  However I expect there is a better way
> to do this ...
>
> --
> Julian
>
>   ---
> Quark!  Quark!  Beware the quantum duck!


    Thank you for the hint about git-new-workdir! I will try it.

    Now for the export thing... I know that I can just clone the
remote repository and then remove the .git folder, but for my purpose
I just want to have the HEAD tree downloaded, without any history...
And by using git clone I end up downloading much more than I actually
need.

    I am looking for a feature like 'svn export <repo+tree_path>
<destination_path>'...

    Ciprian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exporting a tree from a repository
  2007-07-14 20:25 Exporting a tree from a repository Ciprian Dorin Craciun
  2007-07-14 21:46 ` Julian Phillips
@ 2007-07-15  7:17 ` martin f krafft
  1 sibling, 0 replies; 6+ messages in thread
From: martin f krafft @ 2007-07-15  7:17 UTC (permalink / raw)
  To: Ciprian Dorin Craciun; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

also sprach Ciprian Dorin Craciun <ciprian.craciun@gmail.com> [2007.07.14.2225 +0200]:
>    Now I know that I can use "git archive | tar -x"... I am looking
> for the same functionality but without the intermediary file... Maybe
> something like "git archive --format=tree <branch>"...

There is no intermediary file.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"when I was a boy I was told
 that anybody could become president.
 now i'm beginning to believe it."
                                                    -- clarence darrow

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Exporting a tree from a repository
  2007-07-15  7:12   ` Ciprian Dorin Craciun
@ 2007-07-15  9:15     ` Alex Riesen
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Riesen @ 2007-07-15  9:15 UTC (permalink / raw)
  To: Ciprian Dorin Craciun; +Cc: Julian Phillips, Junio C Hamano, git

Ciprian Dorin Craciun, Sun, Jul 15, 2007 09:12:08 +0200:
>    Now for the export thing... I know that I can just clone the
> remote repository and then remove the .git folder, but for my purpose
> I just want to have the HEAD tree downloaded, without any history...
> And by using git clone I end up downloading much more than I actually
> need.

Well, if you have a ssh access to remote repository, you can run
git-archive there:

    $ ssh -n 'cd /dir/repo/.git && git --bare archive --prefix=<local-path> <tree>' |tar xf -

or even simplier:

    $ git archive --remote=<remote-host:remote-path> --prefix=<local-path>/ <tree> |tar xf -

(for whatever reason it does not work with just git-daemon).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-15  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-14 20:25 Exporting a tree from a repository Ciprian Dorin Craciun
2007-07-14 21:46 ` Julian Phillips
2007-07-15  6:12   ` Junio C Hamano
2007-07-15  7:12   ` Ciprian Dorin Craciun
2007-07-15  9:15     ` Alex Riesen
2007-07-15  7:17 ` martin f krafft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox