Skip to content

Instantly share code, notes, and snippets.

@Jeremiah-England
Created November 21, 2020 22:46
Show Gist options
  • Save Jeremiah-England/fae56572b20f18927ff496de5f7a4b39 to your computer and use it in GitHub Desktop.
Save Jeremiah-England/fae56572b20f18927ff496de5f7a4b39 to your computer and use it in GitHub Desktop.
Syncing Getting Things Gnome with Git

Syncing Getting Things Gnome with Git

The Getting Things Gnome application is what I'm currently using for David Allen's Getting Things Done self-management method. The application was stagnant for a few years but has recently been revived. The new team has not had the time to catch up the old plugins that synced different computers using Remember The Milk (there may have been others as well?)

So I am using Git for syncing instead, and this is a short tutorial on how I'm doing it.

I installed GTG from the Flatpak repository, the suggested method on the GTG website.

flatpak install flathub org.gnome.GTG

When installed from Flatpak, everything about GTG is stored in this location:

~/.var/app/org.gnome.GTG

So I created a git repository in that folder.

cd ~/.var/app/org.gnome.GTG
git init

After some fussing, I converged on the following for my .gitignore file:

# Ignore everything!
*

# Except everything in data/gtg and a few honarable mentions
!data/gtg/*

!README.md
!.gitignore

# But still ignore data/gtg/backup
# because the history is in git anyway
# And it just takes up room.
data/gtg/backup

As you can see I could have put the repository in the .../data/gtg folder and still have access to everything I want to sinc, but I like having it in a directory that has access to all GTG files so that if I discover later on that some plugin information is stored in a different folder or something then can just unignore that file or folder.

Finally, I have a few bash aliases and functions in my ~/.bash_aliases which I use to update the repository before switching to my other computer. Here's an example of what it looks like on my laptop.

alias gtgrepo="cd ~/.var/app/org.gnome.GTG"

gtgpush() {
    git add .
    git commit -m "update laptop"
    git push
    git checkout master
    git merge laptop
    git push
    git checkout laptop
}

gtgpull() {
    git checkout master
    git pull
    git checkout laptop
    git merge master
    git push
}

Note that I haven't really tested the gtgpull yet because I've mostly used GTG on my laptop since I I wrote that function. But I will update this if I find a problem with it.

The downside to this is that you have to remember to gtgpush when you are finished using GTG on one computer and gtgpull when you move to the next one. But for my purposes, that's actually been working out OK.

Bonus Feature: Different 'Accounts'

After working with it for a day, I realized that I could actually have a work branch on my machine that I use for work. And if I ever think of something that I absolutely need to add to my personal GTG 'account' when I'm working, I can (1) close GTG, (2) checkout and pull my personal branch, (3), open GTG and add the task, and (4) close GTG and checkout my work branch again.

I can keep both the work branch and my personal branch in the same repository as if they were two separate repositories. I just never merge them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment