summaryrefslogtreecommitdiff
path: root/doc/todo/A_Way_To_Extract_Previous_Versions_of_a_File_From_a_Direct_Repo.mdwn
blob: c8c2dd83e2c6251a1ac4527e925830ffe0cdac0c (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
One problem I keep having when using a direct repo is that in order to get to the previous versions of a file you have to convert that repo to indirect and then checkout previous commits this becomes problematic when the repo in question is large conversion takes a long time and applications gets confused if there are open files from the repo as they go from actual files to symlinks. Is it possible to have a separate annex command that will checkout a previous version of a file to a different directory so we can replace/inspect it.

> I recently added a `git annex proxy` command, which can be used
> to amoung other things, rewind a direct mode repo to have some old
> version checked out.
>
> For example, you can do: `git annex proxy git checkout old-version`
> And then the old version of all annexed files will be checked out.
> 
> If the old version of a file is not available, it'll be a broken
> symlink and you can then use `git annex get` etc to get the content from
> some remote. 
> 
> Once you have the old version of the file, you can
> make a copy, and then switch back to the present with `git annex proxy
> git checkout annex/direct/master`. Then you can add the copy of the old
> version of the file to the repo, or whatever.
> 
> Or, sometimes more simply, you can `git annex proxy git revert $commit`
> to revert a commit that made an unwanted change to a file.
> 
> Or, simpler still, `git annex undo $file` will undo the last change
> that git-annex committed to that file, bringing back the old version.
> 
> So, this seems [[done]]! --[[Joey]]