{"thread":{"id":"65697","subject":"[PATCH 0/5] git son: add command to create independent child repositories","startedAt":"2026-05-26T16:47:34Z","lastAt":"2026-06-01T05:33:13Z","messageCount":9,"participants":["Evan Haque via GitGitGadget","Ben Knoble","Claus Schneider","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"544113","messageId":"pull.2122.git.1779814052.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":null,"subject":"[PATCH 0/5] git son: add command to create independent child repositories","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:26Z","receivedAt":"2026-05-26T16:47:34Z","isPatch":true,"body":"\nMotivation\n==========\n\nWhen spinning off a new project that is related to an existing repository,\nthere is no built-in way to create a child repository that maintains a link\nback to its parent without the tight coupling of submodules. Submodules pin\nthe child to a specific commit and require the parent to track the child in\nits index, which is too heavyweight when the child is meant to be fully\nindependent.\n\nThe typical workflow today is manual: git init, git remote add, update\n.gitignore — three steps that are easy to forget or get wrong. git son\nautomates this and establishes a lightweight convention for the parent-child\nrelationship: a remote named parent in the child, and nothing in the parent\nexcept an ignore rule.\n\n\nSummary\n=======\n\nThis series introduces git son, a new porcelain command that creates an\nindependent child repository inside the current working tree. Unlike a\nsubmodule, the child is not tracked by the parent; instead, its subdirectory\nis added to the parent's .gitignore. The child is configured at creation\ntime with a remote named parent pointing back to the parent repository's\norigin URL (or local path if no origin exists), making the lineage explicit\nand recoverable via standard Git commands.\n\n\nChanges\n=======\n\n * git-son.sh: new shell script implementing the command, supporting\n   --inherit to fetch parent history at creation time and --branch <branch>\n   (requires --inherit) to check out a specific parent branch\n * git-son registered in command-list.txt as mainporcelain\n * git-son.sh added to SCRIPT_SH in Makefile and to scripts_sh in\n   meson.build\n * Documentation/git-son.adoc: new man page covering synopsis, option\n   descriptions, and worked examples\n * Documentation/meson.build: git-son.adoc added to the manpage build list\n * t/t5151-son.sh: new test script covering basic creation, parent remote\n   configuration, .gitignore update, idempotency failure, flag validation,\n   and --inherit with a bare remote\n\n\nDetails\n=======\n\nThe key design property is independence: the child is a fully self-contained\nrepository with no entry in the parent's index. The parent remote is the\nonly artifact linking the two, which means git fetch parent and git log\nparent/<branch> work as expected from within the child without any special\ntooling.\n\nThe --branch flag is intentionally restricted to --inherit mode. Without\nfetching, there is no remote-tracking branch to check out from, so accepting\n--branch alone would be misleading; the command dies with a clear diagnostic\nin that case.\n\nWhen no origin URL is available in the parent, the parent remote is set to\nthe parent's absolute local path. This covers the common case of\nrepositories that have never been pushed to a remote.\n\n\nTesting\n=======\n\nt/t5151-son.sh covers the following scenarios:\n\n * Basic child repository creation (directory exists, .git present)\n * parent remote is correctly recorded in the child\n * Child directory is appended to the parent's .gitignore\n * Child starts with exactly one initial commit when --inherit is not used\n * Command fails without leaving a directory when the target already exists\n * --branch without --inherit is rejected before any filesystem changes\n * --inherit fetches parent history and the remote-tracking branch is\n   reachable in the child\n\nEvan Haque (5):\n  git-son: add command to create independent child repositories\n  git-son: register in Makefile and meson build system\n  git-son: add to command list as mainporcelain\n  git-son: add documentation\n  git-son: add tests\n\n .gitignore                 |  1 +\n Documentation/git-son.adoc | 64 +++++++++++++++++++++++++\n Documentation/meson.build  |  1 +\n Makefile                   |  1 +\n command-list.txt           |  1 +\n git-son.sh                 | 97 ++++++++++++++++++++++++++++++++++++++\n meson.build                |  1 +\n t/meson.build              |  1 +\n t/t5151-son.sh             | 63 +++++++++++++++++++++++++\n 9 files changed, 230 insertions(+)\n create mode 100644 Documentation/git-son.adoc\n create mode 100755 git-son.sh\n create mode 100755 t/t5151-son.sh\n\n\nbase-commit: aec3f587505a472db67e9462d0702e7d463a449d\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2122%2FEvandabest%2Fgit-son-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2122/Evandabest/git-son-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2122\n-- \ngitgitgadget\n"},{"id":"544114","messageId":"ec2bdddf814e018c543d0e2bb393ae8c144207aa.1779814052.git.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"[PATCH 1/5] git-son: add command to create independent child repositories","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:27Z","receivedAt":"2026-05-26T16:47:35Z","isPatch":true,"body":"From: Evan Haque <evanhaque1@gmail.com>\n\nIntroduce git-son, a new porcelain command that creates an independent\nchild repository inside the current working tree. Unlike submodules,\nthe child is not tracked by the parent; instead its directory is added\nto the parent's .gitignore and a \"parent\" remote is configured in the\nchild pointing back to the parent's origin URL or local path.\n\nThis gives users a lightweight way to spin off a related repository\nthat knows where it came from without the coupling that submodules\nimpose.\n\nThe command supports two optional flags:\n\n  --inherit    fetch the parent's history into the child at creation\n  --branch     check out a specific parent branch (requires --inherit)\n\nAssisted-by: Claude Opus 4.6\nSigned-off-by: Evan Haque <evanhaque1@gmail.com>\n---\n git-son.sh | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 97 insertions(+)\n create mode 100755 git-son.sh\n\ndiff --git a/git-son.sh b/git-son.sh\nnew file mode 100755\nindex 0000000000..a212c7b69f\n--- /dev/null\n+++ b/git-son.sh\n@@ -0,0 +1,97 @@\n+#!/bin/sh\n+#\n+# git-son: create an independent child repository that knows its parent\n+#\n+\n+SUBDIRECTORY_OK='Yes'\n+OPTIONS_SPEC='git son [options] <name>\n+--\n+inherit    fetch parent history into the son\n+branch=    start the son from a specific parent branch\n+'\n+\n+. git-sh-setup\n+require_work_tree\n+cd_to_toplevel\n+\n+inherit=\n+branch=\n+while test $# -gt 0\n+do\n+\tcase \"$1\" in\n+\t--inherit)\n+\t\tinherit=1 ;;\n+\t--branch)\n+\t\tshift\n+\t\tbranch=\"$1\" ;;\n+\t--)\n+\t\tshift; break ;;\n+\t-*)\n+\t\tusage ;;\n+\t*)\n+\t\tbreak ;;\n+\tesac\n+\tshift\n+done\n+\n+name=\"$1\"\n+test -n \"$name\" || usage\n+\n+if test -n \"$branch\" && test -z \"$inherit\"\n+then\n+\tdie \"fatal: --branch requires --inherit\"\n+fi\n+\n+parent_dir=\"$(pwd)\"\n+parent_remote=\"$(git remote get-url origin 2>/dev/null)\" || parent_remote=\n+\n+if test -e \"$name\"\n+then\n+\tdie \"fatal: '$name' already exists\"\n+fi\n+\n+mkdir \"$name\" || die \"fatal: could not create directory '$name'\"\n+\n+if ! echo \"$name/\" >> \"$parent_dir/.gitignore\" 2>/dev/null\n+then\n+\trm -rf \"$name\"\n+\tdie \"fatal: could not update .gitignore\"\n+fi\n+\n+cd \"$name\" || die \"fatal: could not enter directory '$name'\"\n+\n+if ! git init\n+then\n+\trm -rf \"$parent_dir/$name\"\n+\tdie \"fatal: could not initialize repository in '$name'\"\n+fi\n+\n+if test -n \"$parent_remote\"\n+then\n+\tgit remote add parent \"$parent_remote\"\n+else\n+\tgit remote add parent \"$parent_dir\"\n+fi\n+\n+if test -n \"$inherit\"\n+then\n+\tgit fetch parent || die \"fatal: could not fetch from parent\"\n+\tif test -n \"$branch\"\n+\tthen\n+\t\tgit checkout -b \"$branch\" \"parent/$branch\" ||\n+\t\t\tdie \"fatal: could not checkout branch '$branch'\"\n+\telse\n+\t\tgit checkout -b main parent/HEAD 2>/dev/null ||\n+\t\t\tgit checkout -b main \"parent/$(git remote show parent | sed -n 's/.*HEAD branch: //p')\" 2>/dev/null ||\n+\t\t\techo \"warning: could not determine parent HEAD, starting empty\"\n+\tfi\n+else\n+\techo \"# $name\" > README.md\n+\tgit add README.md\n+\tgit commit -q -m \"Initial commit\"\n+fi\n+\n+echo \"\"\n+echo \"Created son repository '$name'\"\n+echo \"  parent: ${parent_remote:-$parent_dir}\"\n+echo \"  inherit: ${inherit:-no}\"\n-- \ngitgitgadget\n\n"},{"id":"544115","messageId":"69129f9ebd4396ebf01a63cf081cfa032931df87.1779814052.git.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"[PATCH 2/5] git-son: register in Makefile and meson build system","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:28Z","receivedAt":"2026-05-26T16:47:36Z","isPatch":true,"body":"From: Evan Haque <evanhaque1@gmail.com>\n\nAdd git-son.sh to SCRIPT_SH in the Makefile and to the scripts_sh\narray in meson.build so that the script is installed alongside the\nother shell-based Git commands during \"make install\" and meson builds.\n\nAlso add /git-son to .gitignore so that the build artifact produced\nfrom git-son.sh is not flagged as an untracked file.\n\nAssisted-by: Claude Opus 4.6\nSigned-off-by: Evan Haque <evanhaque1@gmail.com>\n---\n .gitignore  | 1 +\n Makefile    | 1 +\n meson.build | 1 +\n 3 files changed, 3 insertions(+)\n\ndiff --git a/.gitignore b/.gitignore\nindex 4da58c6754..5f329179c8 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -164,6 +164,7 @@\n /git-show-branch\n /git-show-index\n /git-show-ref\n+/git-son\n /git-sparse-checkout\n /git-stage\n /git-stash\ndiff --git a/Makefile b/Makefile\nindex fb50c57e4f..4791f47af1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -728,6 +728,7 @@ SCRIPT_SH += git-merge-resolve.sh\n SCRIPT_SH += git-mergetool.sh\n SCRIPT_SH += git-quiltimport.sh\n SCRIPT_SH += git-request-pull.sh\n+SCRIPT_SH += git-son.sh\n SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\n \ndiff --git a/meson.build b/meson.build\nindex 052c81f288..538bd4025f 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1973,6 +1973,7 @@ scripts_sh = [\n   'git-mergetool.sh',\n   'git-quiltimport.sh',\n   'git-request-pull.sh',\n+  'git-son.sh',\n   'git-sh-i18n.sh',\n   'git-sh-setup.sh',\n   'git-submodule.sh',\n-- \ngitgitgadget\n\n"},{"id":"544116","messageId":"6cb8924a2740a676f26ee262f35908d03d180b73.1779814052.git.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"[PATCH 3/5] git-son: add to command list as mainporcelain","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:29Z","receivedAt":"2026-05-26T16:47:37Z","isPatch":true,"body":"From: Evan Haque <evanhaque1@gmail.com>\n\nRegister git-son in command-list.txt as a mainporcelain command so\nthat it appears in \"git help\" output and is discoverable through the\nstandard help machinery.\n\nAssisted-by: Claude Opus 4.6\nSigned-off-by: Evan Haque <evanhaque1@gmail.com>\n---\n command-list.txt | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/command-list.txt b/command-list.txt\nindex 21b802c420..880177e0fd 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -186,6 +186,7 @@ git-show                                mainporcelain           info\n git-show-branch                         ancillaryinterrogators          complete\n git-show-index                          plumbinginterrogators\n git-show-ref                            plumbinginterrogators\n+git-son                                 mainporcelain\n git-sparse-checkout                     mainporcelain\n git-stage                                                               complete\n git-stash                               mainporcelain\n-- \ngitgitgadget\n\n"},{"id":"544117","messageId":"652381886f8cf839d533b9322c1c5e5983f3ffe4.1779814052.git.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"[PATCH 4/5] git-son: add documentation","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:30Z","receivedAt":"2026-05-26T16:47:38Z","isPatch":true,"body":"From: Evan Haque <evanhaque1@gmail.com>\n\nAdd a man page (git-son.adoc) documenting the synopsis, options, and\nusage examples for the new command. Register the page in\nDocumentation/meson.build so it is built by the meson doc target.\n\nAssisted-by: Claude Opus 4.6\nSigned-off-by: Evan Haque <evanhaque1@gmail.com>\n---\n Documentation/git-son.adoc | 64 ++++++++++++++++++++++++++++++++++++++\n Documentation/meson.build  |  1 +\n 2 files changed, 65 insertions(+)\n create mode 100644 Documentation/git-son.adoc\n\ndiff --git a/Documentation/git-son.adoc b/Documentation/git-son.adoc\nnew file mode 100644\nindex 0000000000..17ec992bfd\n--- /dev/null\n+++ b/Documentation/git-son.adoc\n@@ -0,0 +1,64 @@\n+git-son(1)\n+==========\n+\n+NAME\n+----\n+git-son - Create an independent child repository that knows its parent\n+\n+SYNOPSIS\n+--------\n+[verse]\n+'git son' [--inherit] [--branch <branch>] <name>\n+\n+DESCRIPTION\n+-----------\n+\n+Create a new independent Git repository inside the current working\n+tree as a subdirectory named `<name>`. Unlike a submodule, the child\n+repository is not tracked by the parent; instead, `<name>/` is added\n+to the parent's `.gitignore`.\n+\n+The child repository is configured with a remote called `parent`\n+pointing back to the parent repository's origin URL (or local path\n+if no origin is set), allowing the child to fetch from the parent\n+at any time.\n+\n+OPTIONS\n+-------\n+--inherit::\n+\tFetch the parent's history into the child repository at\n+\tcreation time. Without this flag, the child starts with a\n+\tsingle initial commit.\n+\n+--branch <branch>::\n+\tWhen used with `--inherit`, check out the given branch from\n+\tthe parent instead of the default branch. This option\n+\trequires `--inherit`.\n+\n+<name>::\n+\tThe name of the subdirectory (and child repository) to create.\n+\tMust not already exist.\n+\n+EXAMPLES\n+--------\n+\n+Create a simple child repository:\n+\n+\tgit son my-tool\n+\n+Create a child that inherits the parent's history:\n+\n+\tgit son --inherit my-fork\n+\n+Create a child starting from a specific parent branch:\n+\n+\tgit son --inherit --branch feature my-experiment\n+\n+Later, from within the child, fetch updates from the parent:\n+\n+\tcd my-tool\n+\tgit fetch parent\n+\n+GIT\n+---\n+Part of the linkgit:git[1] suite\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex f4854f802d..1ae7e5f644 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -139,6 +139,7 @@ manpages = {\n   'git-show-ref.adoc' : 1,\n   'git-show.adoc' : 1,\n   'git-sh-setup.adoc' : 1,\n+  'git-son.adoc' : 1,\n   'git-sparse-checkout.adoc' : 1,\n   'git-stage.adoc' : 1,\n   'git-stash.adoc' : 1,\n-- \ngitgitgadget\n\n"},{"id":"544118","messageId":"4ed8b58566dbe6f56d09c8e98f155cff4a297cfe.1779814052.git.gitgitgadget@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"[PATCH 5/5] git-son: add tests","fromName":"Evan Haque via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-05-26T16:47:31Z","receivedAt":"2026-05-26T16:47:39Z","isPatch":true,"body":"From: Evan Haque <evanhaque1@gmail.com>\n\nAdd t5151-son.sh with nine test cases covering:\n\n - basic child repository creation\n - parent remote configuration in the child\n - .gitignore update in the parent\n - initial commit presence in the child\n - failure when the target directory already exists\n - --branch without --inherit is rejected cleanly\n - no leftover directory on validation failure\n - --inherit fetches parent history\n\nRegister the test in t/meson.build so the meson build system\ndiscovers and runs it.\n\nAssisted-by: Claude Opus 4.6\nSigned-off-by: Evan Haque <evanhaque1@gmail.com>\n---\n t/meson.build  |  1 +\n t/t5151-son.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 64 insertions(+)\n create mode 100755 t/t5151-son.sh\n\ndiff --git a/t/meson.build b/t/meson.build\nindex fd955f44ef..523062df66 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -591,6 +591,7 @@ integration_tests = [\n   't5004-archive-corner-cases.sh',\n   't5100-mailinfo.sh',\n   't5150-request-pull.sh',\n+  't5151-son.sh',\n   't5200-update-server-info.sh',\n   't5300-pack-object.sh',\n   't5301-sliding-window.sh',\ndiff --git a/t/t5151-son.sh b/t/t5151-son.sh\nnew file mode 100755\nindex 0000000000..826cbbfa66\n--- /dev/null\n+++ b/t/t5151-son.sh\n@@ -0,0 +1,63 @@\n+#!/bin/sh\n+\n+test_description='Test git son command.'\n+\n+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup parent repository' '\n+\techo \"parent content\" >file.txt &&\n+\tgit add file.txt &&\n+\tgit commit -m \"Initial parent commit\"\n+'\n+\n+test_expect_success 'son creates child repository' '\n+\tgit son my-child &&\n+\ttest -d my-child &&\n+\ttest -d my-child/.git\n+'\n+\n+test_expect_success 'son sets parent remote in child' '\n+\t(\n+\t\tcd my-child &&\n+\t\tgit remote get-url parent\n+\t)\n+'\n+\n+test_expect_success 'son adds child to parent .gitignore' '\n+\tgrep \"my-child/\" .gitignore\n+'\n+\n+test_expect_success 'son child has initial commit' '\n+\t(\n+\t\tcd my-child &&\n+\t\ttest $(git log --oneline | wc -l) -eq 1\n+\t)\n+'\n+\n+test_expect_success 'son fails if target already exists' '\n+\ttest_must_fail git son my-child\n+'\n+\n+test_expect_success 'son with --branch requires --inherit' '\n+\ttest_must_fail git son --branch main branch-child\n+'\n+\n+test_expect_success 'son with --branch leaves no directory on failure' '\n+\t! test -e branch-child\n+'\n+\n+test_expect_success 'son with --inherit fetches parent history' '\n+\tgit init --bare \"$TRASH_DIRECTORY/parent.git\" &&\n+\tgit push \"$TRASH_DIRECTORY/parent.git\" main &&\n+\tgit remote add origin \"file://$TRASH_DIRECTORY/parent.git\" &&\n+\tgit son --inherit inherited-child &&\n+\t(\n+\t\tcd inherited-child &&\n+\t\tgit log --oneline parent/main\n+\t)\n+'\n+\n+test_done\n-- \ngitgitgadget\n"},{"id":"544126","messageId":"7377E3A2-C866-4E3D-85FC-BC6E10CBF8FC@gmail.com","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/5] git son: add command to create independent child repositories","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-05-26T21:27:25Z","receivedAt":"2026-05-26T21:27:37Z","isPatch":true,"body":"\n> Le 26 mai 2026 à 13:08, Evan Haque via GitGitGadget <gitgitgadget@gmail.com> a écrit :\n> \n> ﻿\n> Motivation\n> ==========\n> \n> When spinning off a new project that is related to an existing repository,\n> there is no built-in way to create a child repository that maintains a link\n> back to its parent without the tight coupling of submodules. Submodules pin\n> the child to a specific commit and require the parent to track the child in\n> its index, which is too heavyweight when the child is meant to be fully\n> independent.\n> \n> The typical workflow today is manual: git init, git remote add, update\n> .gitignore — three steps that are easy to forget or get wrong. git son\n> automates this and establishes a lightweight convention for the parent-child\n> relationship: a remote named parent in the child, and nothing in the parent\n> except an ignore rule.\n\nI don’t really understand the motivation, but if your goal is to create another repo with the current one as a remote, how does something like\n\n    git clone . child\n\nhelp you? (I’m pretty sure you can even set the remote name to « parent » if you wish.)\n\nYou also didn’t mention worktrees or subtrees, which might be useful for you. "},{"id":"544267","messageId":"CA+GP4bqNrnER14GaxOSPdQCO0HFJzv6Kjo6VVFhr=KredVu0jw@mail.gmail.com","threadId":"65697","inReplyTo":"7377E3A2-C866-4E3D-85FC-BC6E10CBF8FC@gmail.com","subject":"Re: [PATCH 0/5] git son: add command to create independent child repositories","fromName":"Claus Schneider","fromEmail":"claus.schneider@eficode.com","sentAt":"2026-05-29T12:35:34Z","receivedAt":"2026-05-29T12:35:46Z","isPatch":true,"body":"Hi ..\n\nI would motivate to fix in git-submodules in stead. I updated the\nlogic around the ignored setting of a submodule, so it is truly\nignored - both in git status(already) and `git add`, which now\nexplicitly requires `--force`. It now gives the ability to configure\nyour submodule as 'loosely' by tracking branches without the friction\nof `git add` is staging it all the time and you get conflicts in\nPR/integrations. You can use git submodule status to list the sha1 of\nthe submodule for release etc.\n\nhttps://github.com/gitgitgadget/git/pull/1987\nalias \"git-add: Skip submodules with ignore=all unless --force and\nexplicit path used by bicschneider · Pull Request #1987 ·\ngitgitgadget/git\"\n\nPlease try this update and then describe what is ( still ) missing as\ni am looking into submodules in general and will try to \"fix\" the\nfriction points of developers.\n\nBest regards\nClaus Schneider\n\nOn Tue, May 26, 2026 at 11:29 PM Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n>\n> > Le 26 mai 2026 à 13:08, Evan Haque via GitGitGadget <gitgitgadget@gmail.com> a écrit :\n> >\n> > ﻿\n> > Motivation\n> > ==========\n> >\n> > When spinning off a new project that is related to an existing repository,\n> > there is no built-in way to create a child repository that maintains a link\n> > back to its parent without the tight coupling of submodules. Submodules pin\n> > the child to a specific commit and require the parent to track the child in\n> > its index, which is too heavyweight when the child is meant to be fully\n> > independent.\n> >\n> > The typical workflow today is manual: git init, git remote add, update\n> > .gitignore — three steps that are easy to forget or get wrong. git son\n> > automates this and establishes a lightweight convention for the parent-child\n> > relationship: a remote named parent in the child, and nothing in the parent\n> > except an ignore rule.\n>\n> I don’t really understand the motivation, but if your goal is to create another repo with the current one as a remote, how does something like\n>\n>     git clone . child\n>\n> help you? (I’m pretty sure you can even set the remote name to « parent » if you wish.)\n>\n> You also didn’t mention worktrees or subtrees, which might be useful for you.\n"},{"id":"544340","messageId":"xmqqh5nmakq1.fsf@gitster.g","threadId":"65697","inReplyTo":"pull.2122.git.1779814052.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/5] git son: add command to create independent child repositories","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-01T05:33:10Z","receivedAt":"2026-06-01T05:33:13Z","isPatch":true,"body":"\"Evan Haque via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Motivation\n> ==========\n>\n> When spinning off a new project that is related to an existing repository,\n> there is no built-in way to create a child repository that maintains a link\n> back to its parent without the tight coupling of submodules. Submodules pin\n> the child to a specific commit and require the parent to track the child in\n> its index, which is too heavyweight when the child is meant to be fully\n> independent.\n>\n> The typical workflow today is manual: git init, git remote add, update\n> .gitignore — three steps that are easy to forget or get wrong. git son\n> automates this and establishes a lightweight convention for the parent-child\n> relationship: a remote named parent in the child, and nothing in the parent\n> except an ignore rule.\n\nAlthough I am personally not interested in this topic even for local\nrepository use, I should point out that using this tool to create\nthis combination of repositories would not be useful for other\npeople who want to clone your arrangement. Other than leaving\ncomments in the parent project, there seems to be no way to specify\nhow or where the child projects should be cloned within the working\ntree of the parent project.\n\nSince Git is primarily a tool for collaboration among people with\ntheir own repositories, I fail see how this feature is something we\nshould ship to all Git users as part of the core distribution.\n\nThanks.\n"}]}