Using git branches unconventionally to store finished works?

Problem

I want to store snapshots of my Sonic Pi project (GitHub) (thread) as finished works, never to be upgraded again.


Existing Solution

Currently, I save a copy of the entire project directory with each work, but:

  1. only a few settings change between works
  2. I have to manually run a diff to refer to past works
  3. I have to change a file path in Sonic Pi to play different works

Proposed Solution

Does it make sense to use git and make a branch for every work? I must ask because this goes against what git is supposed to be used for.

If not, are there other tools for this kind of work management? Am I overlooking something obvious?


I’m asking here because: 1) the use case seems too niche to google an answer, and 2) as an art community, others here might find this relevant.

I think that’s a perfectly good use case for git.
Another option would be to use git tags instead of branches, as they cannot be modified once set. However, I don’t see any problem with using branches.

1 Like

Excellent, thanks for your reply! I’ll start branching my works then. I think I’ll use tags for releases exclusively.

I would support the idea of using tags as they are commonly used to do exactly this: fixing releases of a siftware project

One reason I’d prefer branches for cataloguing personal works and tags for user releases is that my text editor (Atom) has built-in support for quickly switching between branches (but not tags). This allows me to run diffs and swap files automatically.

Atom branches UI

If existing tools aren’t meant to do this, I’m open to the idea of writing my own cataloguing software (if I’m able to). I think it would be 90% git though!

I’ve created a human-readable catalogue file (entry.catalogue.md) to provide information on each work. An entry currently looks like this:

Field Content
Date Completed yyyy-mm-dd
Description Information on a work
Program 20210303-polyphony
Program Version 0.3.6
Title Entry Template

Git doesn’t provide a way to quickly browse many versions of a file across branches, because that’s not what git was built for, so that could be one feature of a cataloguing script/program.

well git show branch:file ? (View a file in a different branch without switching the branch)

Generally I love to work with the JetBrains tools, because they really do a good job. There is one for Ruby called RybyMine. I haven’t tried it yet, but I would expect excellent support for git. Downside: these tools do cost real money …

Thanks, I’ll do some scripting then! I’ll use that command to retrieve all versions of a file such as entry.catalogue.md across my work branches. I could also make a pretty GUI to organise and navigate the results.

Alternatively, maybe I could work with the GitHub API and write everything in JS!

Yes, I’ve worked with the IntelliJ git tool before and I love it. I’ve tried the RubyMine EAP, but I never got used to it.

Update: I found a Node.js package called simple-git, using which I’m going to try building an Electron application for my specific use case of cataloguing with git. Hoping this will look good on my resume LOL!

I prototyped something this evening. The code isn’t organised correctly and the UI needs work to handle more, but it has the one feature I’m looking for, so I’d call it a success.

The above is rather redundant. Quickly checking versions of a file is already built into text editors like VSCode and Atom. The unique (?) feature I’ll be developing is to list many versions at once.