Home Git Repo: init

Over the past few months, I’ve been steadily populating my home NAS with plenty of content. I’ll admit that its been all SFTP transfers. However, recently I was working on a long-term project of mine and it got me thinking – why not setup my own git repository?

The project I’ve recently been working on is a big collection of lessons from the Air Cadet program. Its most of my lesson plans and presentations from the programs curriculum since ~2009. When I initially started, it was just a normal file directory, but it quickly evolved a .git folder that equally as quickly fell out of sync.

Back in September, I needed to do some lesson work so I copied the lessons directory from the NAS to a local directory. I tried fixing the git repo on the NAS, but I was getting some weird errors. My hunch was nested .git folders. As a temporary solution, I wrote out an rsync script to keep everything up to date.

Now that its 2021 and everyone and their dog has a thumb drive with 32GB of storage space, I’ve decided to muscle up and stand up to git. This week I’m going to setup a git repo on my NAS.

My first question though, is where? I have 2 main ideas:

  1. In the location it currently would be in. So my Air Cadet documents would be similar to /mnt/{USER}/NAS/Documents/Air Cadets/
  2. Create a directory specifically for my git projects: /git/{project}/

While 2 makes the git repo setup locally very clean (git remote add pi pi@ipaddress:/git/project), id only ever have to deal with the path once – during setup. I much prefer option 1 for long-term me as I want to minimize document fragmentation; I dont want files for one project to be split in multiple root directories based on what its used for. Work files go in the work directory, pictures go in the pictures directory.