]> dgit.raspbian.org Git - git-annex.git/commitdiff
(no commit message)
authorLukey <Lukey@web>
Thu, 13 Jan 2022 18:08:25 +0000 (18:08 +0000)
committeradmin <admin@branchable.com>
Thu, 13 Jan 2022 18:08:25 +0000 (18:08 +0000)
doc/tips/using_nested_git_repositories.mdwn [new file with mode: 0644]

diff --git a/doc/tips/using_nested_git_repositories.mdwn b/doc/tips/using_nested_git_repositories.mdwn
new file mode 100644 (file)
index 0000000..6ebd9e6
--- /dev/null
@@ -0,0 +1,7 @@
+Using nested git repositories in git is not possible and thus this also applies to git-annex. However, here is a good workaround that I found:
+
+Rename the `.git` directory of the nested repo to `dotgit` (or similar), `git annex add` it and then create a symbolic link from `.git` to `dotgit`. It's important that the link is created only after the nested repo has been `git annex add`'ed. Also, the link needs to be created manually on each clone. Finally you'll need to hide the `dotgit` directory from the nested repo itself by adding `/dotgit` to `dotgit/info/exclude`.
+
+    mv nested/.git nested/dotgit; echo "/dotgit" >>nested/dotgit/info/exclude
+    git annex add nested; git commit -m "add nested"
+    cd nested; ln -s dotgit .git # needs to be done on every clone