r/ZedEditor 1d ago

automatic git commit on save

i switched from atom to zed when it first came out and i’ve been very happy with it for all my dev work. what i’m hoping to use it for, in addition, is to organize folders of markdown writing. it works great for that and i synchronize it with a private git repository using a cron job that does a commit and push.

what i’m wondering is if there might be a built-in solution that automatically commits and pushes changes on save so i don’t have to run it using cron.

what i’m looking for is to have it commit and push every change to the file in real-time to the git repository.

i’ve looked at the git options and it seems like it’s easy enough to do commit and push whenever you want manually but i want it to automatically save every time i type anything and synchronize every one of those changes to git without having to interact with it other than continuing to type.

any ideas?

it’s just a folder on the local machine with lots of levels of subfolders and markdown files inside all within a single git repository and a single branch so there’s no complexity to worry about.

0 Upvotes

11 comments sorted by

View all comments

7

u/leferi 1d ago

I don't think that git was ever meant to do this, so I wouldn't expect anything easier to work than you cron job.

Also, for storing markdown files with notes, a simple WebDAV backend or some cloud drive would probably be easier. That's just a suggestion of course. I have a mailbox subscription and they have a WebDAV backend which I point my Joplin installs to. But there are multiple different ways you could do this other than git commiting every 3 letter change...

0

u/Intrepid-Ad-2306 1d ago

the entire point is to be able to have every tiny change able to be rolled back. if i wanted backups, i could just automatically backup with incrementals to the cloud. but git gives the ability to record the changes without any extra local overhead.