I would like git annex sync
to only sync git-annex
's bookkeeping metadata, and not my master branch or file content.
I tried setting annex.synconlyannex = true
(in ~/.gitconfig
), and was surprised to find that although that disables syncing of my master branch, it enables syncing of content.
I can add --no-content
on the command line, but I'd rather not type that every time. Is there a way to do it purely through ~/.gitconfig
? (Maybe consider it as a feature request?)
(Motivation: I find it jarring when git annex creates git commits on my own branches without asking me. I already set annex.autocommit = false
, but git annex sync
will still make merge commits unless I set annexsynconlyannex = true
.)
The merge commits that git-annex sync still makes with annex.autocommit set to false are the same as the merge commits that git pull makes (with the addition of merge conflict resolution that annex.resolvemerge can prevent).
The idea with annex.synconlyannex is that a user, who has their own git workflow already and does not want to change it, can set that and use git-annex sync to sync all the git-annex data.
Adding new configurability to git-annex sync is a tarpit: If left unchecked it will parameterize every single bit of it. So, having realized this, I prefer to only add new configurability only when I have a broad use case for it, like the one that led to annex.synconlyannex.
It is easy enough to write a small shell script that syncs only the git-annex branch, using appropriately low-level commands:
Thanks joey, your script is useful and I can use it as a workaround if necessary.
I still don't understand the reason behind the behaviour. Why does
annex.synconlyannex = true
cause content to be synced? Wouldn't it be simpler to just say content is synced iffannex.synccontent
is set to true? (I leave at the default,false
, because I don't want content to be synced, but that does not help.)Clarification:
git annex sync --no-content ...
is working fine for me. So I don't need the script.I guess I can define a shell alias to fill in the
--no-content
part.