* Submodule URL
@ 2011-06-27 22:38 Hilco Wijbenga
[not found] ` <201106272258.p5RMwOxK028539@no.baka.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hilco Wijbenga @ 2011-06-27 22:38 UTC (permalink / raw)
To: Git Users
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
Hi all,
As I was creating a script to support a question about submodules I
ran into something that I don't understand. I've attached a simple
script that fails to execute properly. I don't understand why.
In essence, I'm setting up 2 separate, bare repositories on the local
file system. One is intended to be a submodule, the other the umbrella
project. I then try to clone the umbrella project. Although I use
complete, absolute file:// URLs git submodule update --init fails
because .gitmodules uses a relative URL instead of the absolute URL I
provided initially. (Naturally, a relative URL could work too but it
would have to be a different one.) :-)
Should I use a different syntax? Or are file:// URLs not supported for
submodules? Or am I simply misunderstanding how this is supposed to
work?
Cheers,
Hilco
[-- Attachment #2: submodule-repo --]
[-- Type: application/octet-stream, Size: 785 bytes --]
#!/bin/bash
ROOT=$(pwd)
DIR=$ROOT/$(date +%Y%m%d%H%M%S)
REMOTE=$DIR/remote
LOCAL=$DIR/local
mkdir -p $LOCAL
cd $LOCAL
git init --bare $REMOTE/the-module-repo
git clone file://$REMOTE/the-module-repo the-module
cd the-module
touch the-module-file.txt
git add the-module-file.txt
git commit -m 'Version 1.'
git push origin master
rm -rf $LOCAL/the-module
cd $LOCAL
git init --bare $REMOTE/umbrella-repo
git clone file://$REMOTE/umbrella-repo umbrella
cd umbrella
touch file.txt
git add file.txt
git clone file://$REMOTE/the-module-repo the-module
git submodule add ./the-module
git commit -m 'Version 1.'
git push origin master
rm -rf $LOCAL/umbrella
cd $LOCAL
git clone file://$REMOTE/umbrella-repo umbrella
cd umbrella
git checkout master
git submodule update --init --recursive
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-28 1:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 22:38 Submodule URL Hilco Wijbenga
[not found] ` <201106272258.p5RMwOxK028539@no.baka.org>
2011-06-28 1:28 ` Hilco Wijbenga
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).