git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git clone --update ?
@ 2011-01-07 22:54 Darxus
  2011-01-07 23:41 ` Zenaan Harkness
  0 siblings, 1 reply; 2+ messages in thread
From: Darxus @ 2011-01-07 22:54 UTC (permalink / raw)
  To: git

I'm working on a build script that pulls source from 12 git repos:
http://www.chaosreigns.com/wayland/wayland-build-ubuntu-all.sh

I would like to be able to do the equivalent of:

 rm -rf gtk+; git clone git://git.gnome.org/gtk+ --branch gdk-backend-wayland

Without re-downloading the entire thing.  Even if I made any kind of
modifications to the repo.

One suggestion I've gotten was;

  git checkout gdk-backend-wayland && git fetch git://git.gnome.org/gtk+ gdk-backend-wayland && git reset --hard FETCH_HEAD && git clean -fxd

Possibly replacing the branch name with HEAD if I want the default branch.

It would be nice if, instead, I could just run something like:

  git clone --update git://git.gnome.org/gtk+ --branch gdk-backend-wayland

Bonus points for working if I have not already cloned it.

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

* Re: git clone --update ?
  2011-01-07 22:54 git clone --update ? Darxus
@ 2011-01-07 23:41 ` Zenaan Harkness
  0 siblings, 0 replies; 2+ messages in thread
From: Zenaan Harkness @ 2011-01-07 23:41 UTC (permalink / raw)
  To: Darxus; +Cc: git

On Sat, Jan 8, 2011 at 09:54,  <Darxus@chaosreigns.com> wrote:
> I'm working on a build script that pulls source from 12 git repos:
> http://www.chaosreigns.com/wayland/wayland-build-ubuntu-all.sh
>
> I would like to be able to do the equivalent of:
>
>  rm -rf gtk+; git clone git://git.gnome.org/gtk+ --branch gdk-backend-wayland
>
> Without re-downloading the entire thing.  Even if I made any kind of
> modifications to the repo.

Are you aware of local cloning? ie:
  git clone ../my-repos/gtk+ --branch gdk-backend-wayland

First of course, you create my-repos/ somewhere, and inside that dir, run
  git clone --bare git://git.gnome.org/$which $which.git
for each of your 12 repos that your build script will work with.

Then whilst in my-repos/, when you need to update from upstream, do:
  for i in *; do cd $i; git fetch; cd ..; done

Your build scripts can clone from your local repos as often as you
like, without ever hitting the server.

But your question suggests you really have not read much git
documentation or experimented much - there is a heap, and lots of it
high quality. Read, do, learn.

Good luck
Zen

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

end of thread, other threads:[~2011-01-07 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07 22:54 git clone --update ? Darxus
2011-01-07 23:41 ` Zenaan Harkness

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).