I have to keep our datasets on an NFS filer that does not support symlinks. On initializing a datalad dataset, I get the message that we are now using git annex’s adjusted branches. Using datalad save
, the tree of commits grows like this.
* git-annex adjusted branch (HEAD, adjusted/master(unlocked))
*┘ [DATALAD] Recorded changes (master)
│* git-annex adjusted branch [dangling]
*┘ [DATALAD] Recorded changes
│* git-annex adjusted branch [dangling]
*┘ [DATALAD] Recorded changes
So I am on the adjusted/...
branch, but my changes are rebased to the master
branch automatically by datalad, presumably to create and commit the symlinks on-the-fly before committing, as they are not supported on my filesystem. Finally, a new adjusted branch is created onto the new commit and checked out. The previous adjusted branch is abandoned (dangling)
But because I cannot have symllinks, I also cannot check out anything on the master branch without errors. But if I want to checkout a different version, how do I do it? I have to check out the respective commit on the master branch first and then adjust. My current solution is (in this example going back 3 commits on master)
checkout -b test master~3 # cannot enter adjusted branch from detached HEAD state
reset --hard HEAD # neccessary, else error: Your local changes to the following files would be overwritten by checkout: ...
git annex adjust --unlock --force # remove potential prior adjusted branch of test
That is a lot of destructive commands (reset --hard
, --force
) … is there any way that is less dangerous?
Unfortunately the documentation by git annex on adjusted branches is quite sparse, so I do not understand what datalad is doing under the hood with adjusted branches.