aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/Can__39__t_add_a_git_repo_to_git_annex__58_____34__Invalid_path_repo__47__.git__47__X__34___for_many_X.mdwn
blob: 6c7444afd150334cb33b4748c7e7bc98796c1e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
I have some git repositories I don't edit often that I'd like to back up.  I'd like to add these to my git annex, so I don't have to resort to a time-consuming hack (such as setting up a proper submodule, or bundling the repositories).

But when I try to add a .git directory to git annex, I get a bunch of errors of the form

    git-annex: user error (xargs ["-0","git","--git-dir=/tmp/tmp.LhGN3nT9uM/annex/.git","--work-tree=/tmp/tmp.LhGN3nT9uM/annex","add","--"] exited 123)
    failed
    git-annex: add: 1 failed
    add repo/.git/hooks/pre-push.sample ok
    (Recording state in git...)
    error: Invalid path 'repo/.git/hooks/pre-push.sample'
    error: unable to add repo/.git/hooks/pre-push.sample to index
    fatal: adding files failed

STR:

    $ mkdir annex
    $ cd annex
    annex$ git init
    annex$ git annex init
    annex$ cd ..

    $ mkdir repo
    $ cd repo
    repo$ git init
    repo$ cd ..

    $ mv repo annex
    $ cd annex
    annex$ find repo | xargs -n1 git annex add
    # Lots of errors of the form above.

You can't simply do `git annex add repo` because that will ignore the .git directory.  Similarly,` git annex add .git` (which I'd think really should try to add the contents of the .git directory) ignores everything.

I don't know what this error means.  Is there a right way to work around this?

> [[!meta title="cannot add .git/ to a git repository. even when using git-annex."]]
> [[!taglink confirmed]] (but may be out of scope for git-annex) --[[Joey]]