scottmuc / infrastructure

Documentation / Automation for personal third-party infrastructure
The Unlicense
10 stars 2 forks source link

Setup PI to be an alternate git remote #69

Closed scottmuc closed 3 months ago

scottmuc commented 3 months ago

In the spirit of digital homesteading, I would like to self host my git repositories. GitHub is way over-featured for what I really need. I may keep using it as a mirror until I have a public interface on top of what I implement here.

I will continue to use GitHub Issues.

Done When

Out of Scope

scottmuc commented 3 months ago

First Attempt

~/workspace/infrastructure ? git remote add pi git@pi:scottmuc/infrastructure.git

~/workspace/infrastructure ? git push pi HEAD
Enumerating objects: 5184, done.
Counting objects: 100% (5184/5184), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2061/2061), done.
Writing objects: 100% (5184/5184), 3.28 MiB | 12.50 MiB/s, done.
Total 5184 (delta 3022), reused 4826 (delta 2807), pack-reused 0
remote: Resolving deltas: 100% (3022/3022), done.
To pi:scottmuc/infrastructure.git
 * [new branch]      HEAD -> main
 * 
~/workspace/infrastructure ? git lla -2
* ff887e5 (HEAD -> main, pi/main) Add background color "smarts" to nvim config
* 87be352 (origin/main, origin/HEAD) Ditching delta

The 0b90dda commit adds the functionality that enables the above commands to work. Some noteworthy configuration to reflect on is:

scottmuc commented 3 months ago

Summary

This was easier than I thought to implement this. It's given me enough information to ponder how I want to go forward with this. For now I'm happy with my pi being a lagging mirror of what's on GitHub.

To keep my mirror up-to-date, I can run the following:

cd
mr update
mr run git push pi HEAD

That being said, my PC and laptop are also mirrors. The goal here is to self-host origin at some point. When repaving the PI, I'll need to add instructions to ensure latest code is fetched since origin will technically be down when doing the repave :).

Todo (for another time)