git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rfc] git submodules howto
@ 2007-09-18 10:55 Miklos Vajna
  2007-09-18 12:03 ` Johannes Schindelin
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Miklos Vajna @ 2007-09-18 10:55 UTC (permalink / raw)
  To: git

[-- 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 --]

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

end of thread, other threads:[~2007-09-24  8:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-18 10:55 [rfc] git submodules howto Miklos Vajna
2007-09-18 12:03 ` 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

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