Hi,
So lately I've been using git-annex to sync repos with only markdown files for Obsidian. Running git annex sync --no-content
works well for this. But I have to remember when I've updated my Obsidian files on one system and make sure to sync to other repos.
Could I use the assistant for this? For repos with annexed files, I've always preferred to manually manage my repos, so I've never used the assistant.
Ideally, as I commit changes, it tries to sync them to other systems, and if those systems are offline (my MBP is closed for example and the ssh connection therefore times out), nothing explodes.
Is this possible? Is it possible with a half dozen similar repos? Can a single agent do this or do I need to start one for each repo?
Thanks!
The assistant should do this, you'll have to set up the git repos yourself though, not using the webapp, since that only sets up git-annex repos.
Is it possible to configure it to sync only, and not auto-commit? Making a few changes to a markdown file in Obsidian, I see a commit each time I press CTRL-S; I tend to save often, so this creates quite a few commits.
Thanks!
That's fantastic. I'm working on an init script and a launchd configuration for OS X that I can post once it's working. It's more of an experiment, but someone else might find it useful to customize.
Thanks.
For anyone that finds this in the future, on OS X you can setup the agent to run at login with a launchd script similar to the following:
You'll need to put it into:
~/Library/LaunchAgents/com.example.gitannexassistant.plist
And load it with
launchctl load ~/Library/LaunchAgents/com.example.gitannexassistant.plist
But don't forget to populate
~/.config/git-annex/autostart
with each repo, one per line.Enjoy!
So I tried
annex.autocommit=false
but, contrary to what the man page suggests and what Joey said, the that also disables syncing.It's actually the very setting the assistant modifies when toggling syncing on a repo.
How can I configure the assistant such that it only syncs commits I have added manually and does not create commits on its own?
@Atemu would have been a good idea to file a bug about that.
I think the assistant would probably eventually get around to pushing a commit that you made with annex.autocommit=false, but it did not promptly notice such commits and push them.
I've made a small change that does make it promptly push commits that were made to the current branch.
Oh! Didn't know that was a bug.
Syncing works just fine with autocommit=false in my limited tests just now, thanks!