TiddlyWiki and Git

1,325 views
Skip to first unread message

Derek Mahar

unread,
Oct 18, 2017, 1:23:33 PM10/18/17
to TiddlyWiki
How difficult is it typically to resolve merge conflicts between two TiddlyWiki HTML files?  I'm considering using TiddlyWiki, Nginx, Git, and SSH to share and synchronise my TiddlyWiki notes.

Derek

Jed Carty

unread,
Oct 18, 2017, 1:32:52 PM10/18/17
to TiddlyWiki
I have never tried. I imagine it would be the sort of thing that would make me cry.

If you use the node version than the diffs for the individual tiddlers may not be horribly difficult.

Rob Hoelz

unread,
Oct 18, 2017, 2:22:39 PM10/18/17
to TiddlyWiki
I have "tried", and by "tried" I mean I gave up, figured out which tiddlers changed in one file, exported those, and imported them into the original.  I would be very afraid to break the resulting HTML from a manual merge.  You might be able to write a merge tool that uses the tiddlywiki command line program to help you, but...

I would try the Node version - it's way easier to handle merges that way.  I actually ended up writing a Git filter-branch invocation to convert my old HTML files to tiddler directories to make things easier on other Git tooling.

-Rob

PMario

unread,
Oct 18, 2017, 3:03:43 PM10/18/17
to TiddlyWiki
On Wednesday, October 18, 2017 at 7:23:33 PM UTC+2, Derek Mahar wrote:
How difficult is it typically to resolve merge conflicts between two TiddlyWiki HTML files?  I'm considering using TiddlyWiki, Nginx, Git, and SSH to share and synchronise my TiddlyWiki notes.

As Rob wrote, that's probably not the best way to go.

-m

jwd

unread,
Oct 18, 2017, 9:55:58 PM10/18/17
to TiddlyWiki
It was the issues with git merge conflicts between single TiddlyWiki HTML files that pushed me over the edge to adopting the node.js / single file per tiddler approach and subsequently the TiddlyServer wrapper around that.

If your goal is sharing and synchronizing TW contents made on different, disconnected platforms I was unable to find another, easier way.

I've also found that, for a subset of tiddlers that I want to 'share' between two or more TiddlyWikis, the includeWikis capability of tiddlywiki.info works well for me. I have work, home, and a few other wikis, for example, all in a git repo. Changes I've made to TiddlyWiki configuration itself I keep in a sibling, Common TiddlyWiki tiddler collections; that I include in the sibling wikis via

      "includeWikis": [
            "../Common",
      ],

That way I make the configuration change once and, on a node.js / TiddlyServer restart (and browser refresh), they all get the same configuration. If its something new I'll try it in one wiki and, once I'm satisfied, shuffle the tiddler file from its original wiki into the Common collection as part of git repo management.

Derek Mahar

unread,
Oct 19, 2017, 1:13:58 PM10/19/17
to tiddl...@googlegroups.com
Thank you all for your suggestions!

On Wednesday, 18 October 2017 21:55:58 UTC-4, jwd wrote:
It was the issues with git merge conflicts between single TiddlyWiki HTML files that pushed me over the edge to adopting the node.js / single file per tiddler approach and subsequently the TiddlyServer wrapper around that.

I really like TiddlyWiki, but I'm trying to limit to Git and SSH the tools that I need to synchronise and share my notes.  (Turns out that I don't really need Nginx, afterall, because I don't need HTTP/S.)  I'm leaning towards keeping a collection of Markdown notes, the changes to which I'll track in a Git repository.

If I were starting with a TW containing a large number of tiddlers, I'd most certainly bite the bullet and install Node.js.  However, I'm actually starting with a small number of Markdown notes which I store in Turtl on Framanotes, old Gnotes, and some notes stored on Google Keep and Evernote.  My goal is to migrate and consolidate these onto my own FreeBSD NAS using a minimum set of tools, preferably limited to ones that I've already installed.

Derek

Rob Hoelz

unread,
Oct 20, 2017, 4:18:44 PM10/20/17
to TiddlyWiki
If you do end up using TiddlyWiki with Node and use Git to sync across machines, one thing to keep in mind is that the node daemon loads all of the tiddlers into RAM at startup - meaning if you do a pull, the tiddlers served up won't reflect changes in the repo until you restart the daemon.

Diego Mesa

unread,
Dec 7, 2017, 6:16:13 PM12/7/17
to TiddlyWiki
I've recently been thinking about TW and git and had some ideas and thoughts:

Using git for tiddler revisions:
  • Overwrite the save method of tiddlers so that when you save a tiddler, a new commit object is made.
  • Every tiddler has a "revisions" tab in the info pane, showing previous versions of that tiddler
Working with multiple users:
  • Each tiddler is just a file, so multiple users working on one tiddlywiki, is really just multiple users working from one repository consisting of multiple files. 
  • Everytime TW first loads, it could "pull" the latest changes from a remote location and ask the user to reconcile any conflicts. Your entire TW session is then just really just making of a series of commit objects locally, which can be "pushed" at a later time.  

Jed Carty

unread,
Dec 8, 2017, 4:36:33 AM12/8/17
to TiddlyWiki
Diego,

I experimented with this a bit before making the multi-user plugin. For my group it was much easier to just make the wiki folder a git repo and have a script that would pull any new changes before starting the server and push current changes after you are finished. It works well for things that are only adding to the wiki (like my companies expense reports and invoices wikis) but for anything that actually has collaborative editing git become unwieldy and the ease of using tiddlywiki is lost when you have to manually fix conflicts. That was the big motivation for me to make the multi-user plugin.

As far as displaying old revisions goes, I ran into so many weird edge cases converting git commits into something usable by the wiki that I gave up pretty quickly. I will probably revisit it in the future but I think it will take some significant effort to make it work smoothly.

Rahul Kashyap

unread,
May 17, 2020, 12:19:26 PM5/17/20
to TiddlyWiki
Hi Diego,


I have seen exactly same implementation of TW but, only for single-user mode. Unfortunately, I can't find it again. 
Does anyone know if it has been removed or, was just an implementation in older TW.

Best,
-Rahul
Reply all
Reply to author
Forward
0 new messages