Put browser bookmarks into version control system

5

1

I regularly use three different computers. I keep a lot of data between them in sync using git. This works very well for most purposes.

My only problem is browser bookmarks. Firefox now keeps them in some sort of sqlite database. I could put this into git, but operations like merging then become worthless.

I have looked at a lot of bookmark sync extensions. Currently I use Xmarks, which is the best one, but even it is annoying in some ways. (For instance it now insists on having me log in every time I start up the browser.)

Online bookmarks suffer from various flaws, foremost that the user interface for them typically is terrible compared to the one built in to browsers.

Are there any good ideas for seamless ways to get bookmarks into version control like git? This would be so much simpler if Firefox just kept the bookmarks in a plain text or HTML file rather than in sqlite. So far I can only think of two solutions. One, dump Firefox for another browser. Unfortunately Chromium likely won't be much help as I think it uses a database too. There is uzbl, which would certainly keep bookmarks as plain text, but I would rather not go that route if I can help it as it's a lot of work to get uzbl working. Two, just keep bookmarks in my own plain text file that I can edit with vim. I could do a simple tagging system using awk. This doesn't get me much of a user interface, but this is really the best idea I can come up with so far.

Omari Norman

Posted 2011-02-18T01:46:51.200

Reputation: 203

2I use Chrome and YAGBE and find that it's fine. I think you're making this pretty complex just to avoid an online bookmark storage tool. – jcollum – 2011-02-18T02:10:39.457

Updated my answer due to just noticing another possibility. – JAB – 2011-05-26T17:31:57.310

Answers

1

Two options available within Firefox itself:

Go to (in versions < 4) Bookmarks>Organize Bookmarks or (in 4+) Bookmarks>Show All Bookmarks. There will be a button-dropdown for backing up/restoring/importing bookmarks near the top of the dialog box that appears. There will be options to export your bookmarks as either a JSON file or an HTML file. Restoring from the JSON file will completely replace the current bookmarks, while importing the HTML file will just add all the bookmarks to the Bookmarks menu.

I think the HTML version might be better for merging bookmark files, but would require you to delete all the current bookmarks in Firefox before importing the most recent HTML file to avoid all the duplication that would occur. The JSON version does not have that problem, but I'm not sure how well-suited it would be to merging, as it doesn't use line beaks.

UPDATE:

Just noticed that Firefox 4, at least, offers the option to sync bookmarks, etc. Go to Tools>Options and select the "Sync" tab.

JAB

Posted 2011-02-18T01:46:51.200

Reputation: 151

0

I think the most straightforward way to do this would be to dump the bookmarks from the Sqlite database into a CSV file, then check that into your DVCS. From the

This link on Sqlite.org should get you started on CSV from Sqlite.

There's nothing stopping you from putting the Sqlite db into version control -- you just won't have any compare history as (I think) Sqlite is storing stuff in binary. I'm not seeing the upside of having compare history on a set of bookmarks. It'll probably be a large file but this seems like the path of least resistance.

jcollum

Posted 2011-02-18T01:46:51.200

Reputation: 3 737