forum/Is it possible to cherry pick from a repo?git-annexhttp://git-annex.branchable.com/forum/Is_it_possible_to_cherry_pick_from_a_repo__63__/git-annexikiwiki2021-03-25T18:26:30Zcomment 1http://git-annex.branchable.com/forum/Is_it_possible_to_cherry_pick_from_a_repo__63__/comment_1_82efe5c0b37fdcb31b6a4ca62b66123f/Lukey2021-03-25T18:26:30Z2021-03-25T18:26:30Z
<p>Yes, of course. This is a core feature of git-annex ans is done with <a href="http://git-annex.branchable.com/git-annex-preferred-content/">git-annex-preferred-content</a>. <br>
First step is to let the usb drive want anything with <code>git annex wanted here anything</code>. Then you need to tell git-annex what files you want on the SSD. There are multiple ways to do that:</p>
<p>The simplest one is to set the preferred-content expression on the SSD to something like <code>include=path/to/project_a or include=path/to/project_b or include=...</code> and so on.</p>
<p>Or you can just decide manually what files to keep on the SSD with <code>git annex get</code>. Then you set the preferred-content expression to just <code>present</code>. I think that this should work pretty well with your workflow, since new files will appear first on the SSD and thus are already present.</p>
<p>Tags are the most complicated way to do this. You basically set the preferred-content expression to something like <code>metadata=tag=keeponssd</code>. Then you tag the files you want to keep on the SSD with <code>git annex metadata --force -t keeponssd path/to/project_a</code> (--force makes it recursive). The disadvantage is that if you add new files, you have to manually tag them too or else they will be dropped with the next <code>git annex sync --content --all</code>.</p>
<p>To update/sync changes back to the usb drive, you just run <code>git annex sync --content --all</code>. With --all, it will also copy old versions of files to the usb drive.</p>