On Git Hosting

I use Github every day for work and I don't think that I could ever completely leave it. That said, I am not a fan of some of the moves that Microsoft has been making lately. When it was first announced that Microsoft was buying GitHub, I was pretty skeptical. Over time, they slowly won over my trust with decent features. And then they announced GitHub Copilot and I was reminded that Microsoft is a corporation and they want to turn a profit.

🤖 Welcome to the Machine

I don't want to spend much time writing about GitHub Copilot. There's not much new I can say to add dialog to the conversation. If you haven't heard, Github has been training a machine learning model on code hosting on their site so that they can provide a coding “assistant” that helps you write code. People are upset because it leaks secrets and does not care about licenses.

⛵️ Jumping Ship

I was already looking into Git-hosting alternatives before this story broke. Originally, I had considered moving my work to SourceHut, but the fine folks on Mastodon pointed out some of it's creators shortcomings.

It was a bummer, because I really liked the minimalism of SourceHut. I was also intrigued by the patch / email workflow. I always found it odd that GitHub took a decentralized tool (Git) and forced people to come together to review code in one place (Pull Requests).

In the end, I decided to spin up my own replacement for GitHub and learn a little bit in the process.

🍝 Gist

A replacement for Github gists was pretty easy. All I really needed was a place for me to quickly and easily upload files and send a link to myself / coworkers. I could have done something fancy with syntax highlighting, version control, and styles. I didn't do that:

#!/bin/sh

main() {
  scp "$1" $GIT_PASTE_USER@git.zstix.io:$GIT_PASTE_DIR
  echo "https://git.zstix.io/paste/$1"
}

main "$@"

I can cat out a file and pipe it to this command, which uploads the file and prints out the link. I just need to ensure I have a SSH key setup on whatever machine I'm on. Dirt simple.

Example file.

🏡 Repository Hosting

It turns out that most of my work doesn't need to be seen by anyone. I haven't really done much of value (individually). That said, it can be helpful to reference things in my dotfiles from time to time. I decided to go with a simple tool called stagit to build files. All I need to do is create a bare repository, connect the remote, and push.

It's not perfect, but it's a step in the right direction. The next thing I'd like to do is set up a way to view my repositories / pasted files using the gemini protocol.

#100DaysToOffload #programming #git #github #copilot


PS: you can view this post using the gemini protocol: gemini://zstix.io/gemlog/2021-07-16_on-git-hosting.gmi