From: Miklos Vajna <vmiklos@frugalware.org>
To: git@vger.kernel.org
Subject: [rfc] git submodules howto
Date: Tue, 18 Sep 2007 12:55:38 +0200 [thread overview]
Message-ID: <20070918105538.GL19019@genesis.frugalware.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]
hi,
i saw several "is there any step by step howto on how to use git
submodules?" question on irc, and as far as i think there is none
available at the moment
here is how i use it at the moment:
$ mkdir lib
$ cd lib
$ git init
Initialized empty Git repository in .git/
$ echo "libmakefile" > Makefile
$ dg add Makefile
$ git commit -m "libmakefile"
Created initial commit 57c1dce: libmakefile
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 Makefile
$ cd ..
$ mkdir main
$ cd main
$ git init
Initialized empty Git repository in .git/
$ echo "main makefile" > Makefile
$ git add Makefile
$ git commit -m "main makefile"
Created initial commit 8935291: main makefile
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 Makefile
$ git submodule add ../lib lib
Initialized empty Git repository in /home/vmiklos/scm/git/sub/main/lib/.git/
0 blocks
$ git commit -m "added lib submodule"
Created commit 9dbfedf: added lib submodule
2 files changed, 4 insertions(+), 0 deletions(-)
create mode 100644 .gitmodules
create mode 160000 lib
$ cd ..
$ git clone main cloned
Initialized empty Git repository in /home/vmiklos/scm/git/sub/cloned/.git/
0 blocks
$ cd cloned
$ git submodule init
Submodule 'lib' (/home/vmiklos/scm/git/sub/lib/.git) registered for path 'lib'
$ git submodule update
Initialized empty Git repository in /home/vmiklos/scm/git/sub/cloned/lib/.git/
0 blocks
Submodule path 'lib': checked out '57c1dce0e083e9ee50d06111d6aa1523116c2e15'
$ cat Makefile
main makefile
$ cat lib/Makefile
libmakefile
my questions:
1) is this correct? :) i use it and it seem to do what i except, but
maybe it's not correct
2) does this worth adding to the documentation? maybe to a .txt under
Documentation/howto? or to git-submodule.txt?
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2007-09-18 10:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 10:55 Miklos Vajna [this message]
2007-09-18 12:03 ` [rfc] git submodules howto Johannes Schindelin
2007-09-18 12:10 ` Michael Smith
2007-09-18 13:29 ` J. Bruce Fields
2007-09-18 15:47 ` Miklos Vajna
2007-09-18 15:55 ` J. Bruce Fields
2007-09-18 16:11 ` Miklos Vajna
2007-09-18 18:12 ` Michael Smith
2007-09-19 17:42 ` [PATCH] User Manual: add a chapter for submodules Miklos Vajna
2007-09-19 19:44 ` Junio C Hamano
2007-09-19 20:30 ` J. Bruce Fields
2007-09-20 0:01 ` Miklos Vajna
2007-09-20 0:34 ` Miklos Vajna
2007-09-20 4:15 ` Junio C Hamano
2007-09-20 10:34 ` Johannes Schindelin
2007-09-20 17:08 ` [PATCH] new test from the submodule chapter of the user manual Miklos Vajna
2007-09-20 17:59 ` Joel Becker
2007-09-20 18:47 ` Johannes Schindelin
2007-09-20 21:46 ` Miklos Vajna
2007-09-20 22:56 ` Joel Becker
2007-09-20 21:35 ` Junio C Hamano
2007-09-21 13:09 ` Miklos Vajna
2007-09-21 18:04 ` Junio C Hamano
2007-09-22 20:05 ` Miklos Vajna
2007-09-20 22:02 ` [PATCH] User Manual: add a chapter for submodules Miklos Vajna
2007-09-19 21:00 ` Sven Verdoolaege
2007-09-24 7:11 ` [rfc] git submodules howto Uwe Kleine-König
2007-09-24 8:30 ` Miklos Vajna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070918105538.GL19019@genesis.frugalware.org \
--to=vmiklos@frugalware.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).