Accidental execution of git annex uninit in superdataset

Hi Datalad Team,

I stupidly performed git annex uninit in my superdataset rather than in a subdataset which I wanted to datalad remove (permission issues in the git (annex) repo were preventing me from succesfully executing it), followed by manual removal of .git/annex and .git.

I performed git init and git annex init in the superdataset, reinitiating it as a git and git annex repo (and datalad dataset), but now my original subdatasets are directories in the superdataset rather than actual subdatasets. History will obviously be lost in the superdataset (which is not a disaster), but seems fine in the directories (hence, they are still datalad datasets, but not known by the superdataset). Losing it would not be a huge disaster either though if needed.

No remotes configured yet.

I was checking the datalad create docs but it was slightly unclear to me what would happen with my existing directories (which are datalad datasets on their own already) if I execute the command based on the info that “This command only creates a new dataset, it does not add existing content to it, even if the target directory already contains additional files or directories”.

Could you please advise me on the easiest way to turn these directories into subdatasets again (.gitmodules still exists)?

Stupid mistake, thanks a lot in advance for helping me cleaning up the mess!

Best wishes,

Lukas

Hi All,

Just a gentle reminder on this post, would someone be able to give me advice on how to fix this?

Thanks,

Lukas

Sorry, missed original question.
And I never used uninit… Judging from docs it should’ve not effected submodules etc… But also - do you have a remote clone of this super dataset? We will need to recover git-annex branch.
ATM I am away from the laptop, but would also check if git reflog had idea where git annex branch was right before, so we could recover (unlikely git gc’ed it yet). And you should be able to git reset --hard your main branch and tree to prior state

Before doing anything though, of feasible, I would’ve made backup of that entire folder (filesystem snapshot or plain tarball) so I could experiment and get back if needed

Hi Yarik,

Thanks a ton!

Unfortunately, not remote clone on GIN yet.

Please find the output of git log, git reflog, git branch (listing the git-annex branch), and git status (executed in the superdataset) below. Nothing very helpful atm, but the fact that git branch still lists the git-annex branch seems promising to me? Any advice on how to proceed?

Maybe this is way too simplistic, but what would a datalad save (-r) from the superdataset do?

Thanks a ton!

Best wishes,

Lukas

u0027997@gbw-s-labgas01:/data/proj_moodbugs/proj_moodbugs_wp2$ git log
fatal: your current branch ‘master’ does not have any commits yet
u0027997@gbw-s-labgas01:/data/proj_moodbugs/proj_moodbugs_wp2$ git reflog
fatal: your current branch ‘master’ does not have any commits yet
u0027997@gbw-s-labgas01:/data/proj_moodbugs/proj_moodbugs_wp2$ git branch
git-annex
u0027997@gbw-s-labgas01:/data/proj_moodbugs/proj_moodbugs_wp2$ git status
On branch master

No commits yet

Untracked files:
(use “git add …” to include in what will be committed)
.bidsignore
.datalad/
.gitattributes
.gitignore
.gitmodules
BIDS/
code/
derivatives/
mriqc/
pipeline/
sourcedata/
study_config/

nothing added to commit but untracked files present (use “git add” to track)
u0027997@gbw-s-labgas01:/data/proj_moodbugs/proj_moodbugs_wp2$