git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git submodules.

From
Victor Bogado da Silva Lins <victor@bogado.net>
Date
Apr 28, 2008, 19:50 UTC
Message-ID
<1209412220.29267.22.camel@omicron.ep.petrobras.com.br>
Is there any documentation about how those work?

What I need is this, I have a already existing git repository, that have a subdir that could be seen as submodule (by this I mean that he is related, but could have a different commit tree). The git repository already exists and has many commits that apply to either the submodule or the main module (I would say that there is no commit that touch both). So is it possible to separate them easily? Would it keep my older commits?

bellow is a shell script that samples my setup: 

=========================== cut here ================================= #!/bin/bash

gitdir=git_submodules_dir
if [[ -d $gitdir ]]; then 
	rm -rf $gitdir;
fi
mkdir $gitdir
cd $gitdir
git init

echo "testing 1 2 3" > file_a.txt git add file_a.txt git commit -m "initial setup"

mkdir submodule

echo "submodule file" > submodule/file_b.txt git add submodule/file_b.txt git commit -m "submodule file"

echo "updated main file" >> file_a.txt git commit -a -m "updated file in main module"

echo "updated sumodule file" >> submodule/file_b.txt git commit -a -m "updated file in the submodule" =========================== cut here =================================

Next: Miklos Vajna
Message 1 of 2 in “git submodules.”
  1. Victor Bogado da Silva LinsApr 28, 2008
  2. Miklos VajnaApr 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.