A guide to pushing a single git repository to two remotes, prompted by my running a private Gogs instance alongside GitHub. I cover naming remotes meaningfully rather than relying on the convention of origin, pushing to each remote explicitly, and using the -u flag to set a default remote, which becomes the source of truth for both pushing and pulling. My typical setup treats Gogs as the source of truth, with manual pushes to GitHub when code needs to be shared...
I wanted a private git server for version-controlling my plain-text financial accounts (kept with beancount), rather than pushing them to GitHub. I walk through installing Gogs — chosen over Gitea for being simpler — in Docker on an LXC container, including a storage driver fix needed to get it running, and finish with the first-run setup and pushing a repo...
A step-by-step walkthrough of my routine for starting new Node/Express SSR web projects with HTMX, covering directory setup, npm and git initialization, GitHub repo creation, and my ongoing dilemma about committing htmx.min.js versus using a CDN. In the second half, I describe an Express starter skeleton with EJS views and partials, basic routing with 404 handling, and some starter CSS...
While setting up a small cron-driven script to cache a weather API’s JSON output for serving over Nginx, I run into trouble getting git to preserve the script’s executable bit between macOS and an Ubuntu VPS. After git update-index –chmod=+x fails and toggling the filemode config setting only seems to work by accident, the root cause turns out to be a forgotten fact: macOS does support Unix file permissions, so a plain chmod before committing solves it...
A reflective look at my GitHub commit graph, noting that Tuesday nights are unexpectedly my most productive coding time and expressing my appreciation for git and GitHub’s free tier. My first commits date to July 10, the same month I started blogging daily, a streak now at 154 days. I’m on day 64 of 100 Days of SwiftUI, admitting the hour-per-day pace hasn’t held, but I’m pleased with my overall commitment...
I take a short look at using git stash to temporarily set aside uncommitted changes and revert a directory to the last commit, then git stash pop to restore them — handy for grabbing an earlier version of code. I also briefly mention more advanced stash features like naming, multiple stashes, and viewing diffs, with a link to Atlassian’s guide...
While following a type-along tutorial in the 100 Days of SwiftUI course, I commit the setup code once it’s working, then use git reset –hard to discard each technique’s changes before moving to the next one. I include the handful of git commands involved, suggesting this simple rollback workflow is a good first use case for anyone new to git...
After following along with an app tutorial, I want to collapse all the small commits made along the way into one before pushing the project to GitHub. The solution, borrowed from a Stack Overflow answer, skips rebase and squash tricks entirely: delete the .git directory, re-initialize the repository, and make a single fresh commit...
I explain how to fix Xcode failing to push to GitHub after GitHub stopped accepting RSA keys that use SHA-1. My solution, based on an Apple Developer forum answer, is to switch to a new ECDSA SSH key — with the one step the forum post missed being a restart of Xcode to make it take effect...
I explain how to bring a feature branch’s changes back into the main branch, comparing merge, squash merge, and rebase with example commit histories. I close with a note on why rebasing commits that have been pushed to a shared repository is considered bad practice. Branching per feature is part of my effort to become more competent with git...
A short reflection, prompted by a trending ProgrammerHumor meme, on my now-routine git and GitHub workflow. I cover the Pro Git book as my main source of understanding, my preference for the git CLI in a customized zsh terminal over tools like Xcode, and my open questions about consolidating many small learning repos into a single repository...
While working through the Missing Semester material, I wanted my zsh prompt to display the current git branch name. A bit of searching led me to install Oh My Zsh and enable its git and macos plugins to accomplish it...
A beginner-oriented cheat sheet I put together for using git from the command line on macOS, aimed at people working with Xcode and GitHub. I walk through setting up a new repository and pushing it to GitHub, then cover basic commands for status, add, commit, push, and tagging, along with .gitignore notes and cloning from a tag. I include a short list of git learning resources at the end...
I set up Git and GitHub for the first time by following a video tutorial, working on a Mac. I cover the basic workflow of cloning, staging, committing, and pushing, along with minor troubleshooting around the default branch name, unset git config, and a first encounter with Vim. Generating an SSH key was the only real complexity...