{"thread":{"id":"26235","subject":"git clone --update ?","startedAt":"2011-01-07T22:54:05Z","lastAt":"2011-01-07T23:41:11Z","messageCount":2,"participants":["darxus@chaosreigns.com","Zenaan Harkness"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159178","messageId":"20110107225405.GH20411@chaosreigns.com","threadId":"26235","inReplyTo":null,"subject":"git clone --update ?","fromName":"","fromEmail":"darxus@chaosreigns.com","sentAt":"2011-01-07T22:54:05Z","receivedAt":"2011-01-07T22:54:05Z","isPatch":false,"sender":{"key":"darxus@chaosreigns.com","avatar":null},"body":"I'm working on a build script that pulls source from 12 git repos:\nhttp://www.chaosreigns.com/wayland/wayland-build-ubuntu-all.sh\n\nI would like to be able to do the equivalent of:\n\n rm -rf gtk+; git clone git://git.gnome.org/gtk+ --branch gdk-backend-wayland\n\nWithout re-downloading the entire thing.  Even if I made any kind of\nmodifications to the repo.\n\nOne suggestion I've gotten was;\n\n  git checkout gdk-backend-wayland && git fetch git://git.gnome.org/gtk+ gdk-backend-wayland && git reset --hard FETCH_HEAD && git clean -fxd\n\nPossibly replacing the branch name with HEAD if I want the default branch.\n\nIt would be nice if, instead, I could just run something like:\n\n  git clone --update git://git.gnome.org/gtk+ --branch gdk-backend-wayland\n\nBonus points for working if I have not already cloned it.\n"},{"id":"159180","messageId":"AANLkTimkD6vfDMhJjuwuVrrzVVvd51_ORmp6A4V0JC9L@mail.gmail.com","threadId":"26235","inReplyTo":"20110107225405.GH20411@chaosreigns.com","subject":"Re: git clone --update ?","fromName":"Zenaan Harkness","fromEmail":"zen@freedbms.net","sentAt":"2011-01-07T23:41:11Z","receivedAt":"2011-01-07T23:41:11Z","isPatch":false,"sender":{"key":"zen@freedbms.net","avatar":null},"body":"On Sat, Jan 8, 2011 at 09:54,  <Darxus@chaosreigns.com> wrote:\n> I'm working on a build script that pulls source from 12 git repos:\n> http://www.chaosreigns.com/wayland/wayland-build-ubuntu-all.sh\n>\n> I would like to be able to do the equivalent of:\n>\n>  rm -rf gtk+; git clone git://git.gnome.org/gtk+ --branch gdk-backend-wayland\n>\n> Without re-downloading the entire thing.  Even if I made any kind of\n> modifications to the repo.\n\nAre you aware of local cloning? ie:\n  git clone ../my-repos/gtk+ --branch gdk-backend-wayland\n\nFirst of course, you create my-repos/ somewhere, and inside that dir, run\n  git clone --bare git://git.gnome.org/$which $which.git\nfor each of your 12 repos that your build script will work with.\n\nThen whilst in my-repos/, when you need to update from upstream, do:\n  for i in *; do cd $i; git fetch; cd ..; done\n\nYour build scripts can clone from your local repos as often as you\nlike, without ever hitting the server.\n\nBut your question suggests you really have not read much git\ndocumentation or experimented much - there is a heap, and lots of it\nhigh quality. Read, do, learn.\n\nGood luck\nZen\n"}]}