Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
technical:notes_cherrytree_git_sync [2025/05/15 04:40] – created super_stunder | technical:notes_cherrytree_git_sync [2025/05/27 18:44] (current) – super_stunder | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | cd ~/Documents/CherryTree_Docs/ | + | ====== Using Git to sync CherryTree notes between systems ====== |
+ | As much as I love posting information and stories to this site for others to consume there are other things I don't want put out on the web like my personal journal. | ||
- | git init | + | I have used the application on Windows for keeping track of my projects at work and other one offs. I was really bad about just keeping things in notepad and after a while looked for alternatives. |
- | git status | + | {{ : |
+ | |||
+ | The one feature CherryTree is missing is the ability to sync between different host. I am not trying to sync things between teams of people or anything I just want to sync my own notes between my own devices. | ||
+ | |||
+ | Alright I explained enough about the git repo setup on the host your own git page, in the case of CherryTree I am not going to use the repos directory. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | I saved my documents as SQLite before I started this whole process. | ||
+ | |||
+ | ** Step 1: Initialize the repository from the directory you save CherryTree files in ** | ||
+ | < | ||
+ | nugget@tiptop: | ||
+ | nugget@tiptop: | ||
+ | nugget@tiptop: | ||
On branch main | On branch main | ||
Line 23: | Line 38: | ||
nothing added to commit but untracked files present (use "git add" to track) | nothing added to commit but untracked files present (use "git add" to track) | ||
- | eric@kalin-emcwilliams: | + | |
- | eric@kalin-emcwilliams: | + | nugget@tiptop: |
+ | nugget@tiptop: | ||
On branch main | On branch main | ||
Line 44: | Line 60: | ||
new file: | new file: | ||
- | eric@kalin-emcwilliams: | + | nugget@tiptop: |
[main (root-commit) 1c6be2f] Initialize repository | [main (root-commit) 1c6be2f] Initialize repository | ||
Line 60: | Line 76: | ||
| | ||
| | ||
- | eric@kalin-emcwilliams: | + | nugget@tiptop: |
+ | </ | ||
+ | As you may notice CherryTree has some of its own versioning/ | ||
+ | |||
+ | ** Step 2: Building a bare repo on your git server ** | ||
SSH to your remote host and setup the bare repo: (this is assuming you have the right accounts and sshkeys setup) | SSH to your remote host and setup the bare repo: (this is assuming you have the right accounts and sshkeys setup) | ||
- | ssh eric@gitshed.igazine.com | ||
- | mkdir -p git/ | + | < |
- | git init --bare git/ | + | nugget@tiptop: |
+ | Last login: Tue May 27 15:18:33 2025 from 127.0.0.1 | ||
+ | nugget@gitshed: | ||
+ | nugget@gitshed: | ||
+ | </ | ||
+ | ** Step 3: Pushing to the git server ** | ||
Now return back to the host with the ChreeyTree .ctb files and sync these files to the remote repo. | Now return back to the host with the ChreeyTree .ctb files and sync these files to the remote repo. | ||
- | eric@kalin-emcwilliams: | + | < |
- | eric@kalin-emcwilliams: | + | nugget@tiptop: |
- | eric@kalin-emcwilliams: | + | nugget@tiptop: |
+ | nugget@tiptop: | ||
Enumerating objects: 20, done. | Enumerating objects: 20, done. | ||
Line 81: | Line 106: | ||
Writing objects: 100% (20/20), 158.20 KiB | 17.58 MiB/s, done. | Writing objects: 100% (20/20), 158.20 KiB | 17.58 MiB/s, done. | ||
Total 20 (delta 16), reused 0 (delta 0), pack-reused 0 | Total 20 (delta 16), reused 0 (delta 0), pack-reused 0 | ||
- | To gitshed.igazine.com:/ | + | To gitshed.igazine.com:/ |
* [new branch] | * [new branch] | ||
branch ' | branch ' | ||
+ | |||
+ | </ | ||
And this is my first edit after pulling the DB down to my laptop... Holy Hell it works! | And this is my first edit after pulling the DB down to my laptop... Holy Hell it works! | ||
I am saving these files as SQLite but I am now thinking I could do XML instead, the git merge possiblites are attractive but need to test. | I am saving these files as SQLite but I am now thinking I could do XML instead, the git merge possiblites are attractive but need to test. |