Dotfiles Part 1: A Simple Approach to storing Home Directory Config Files in Git without a Bare Repo

~/.*

Configuration files that reside in your home directory are both precious and dynamic. Given this, storing them in a version control system like Git makes good sense. Due to concerns around complexity, security, and cleanliness, though, no one wants to manage all files in their home directory with version control. Let’s explore how to manage just the important configuration files, also known as “dotfiles”, by selectively committing only the desired files to version control. ...more

January 17, 2021 Updated: July 10, 2023 [Dev] #dotfiles #commandline #git

Dotfiles Part 2: A Bare Repo Approach to storing Home Directory Config Files in Git

~/.*

We can make life easier by using Git to store and version configuration files that reside in a system’s home directory (aka “dotfiles”). But how do we do so selectively and non-invasively, so that only the desired files are committed to version control? This article explores one such method: using a “bare” git repo to track the files. ...more

January 27, 2021 Updated: July 10, 2023 [Dev] #dotfiles #commandline #git

Read Git Default Branch from the Command Line

git logo

On occasion, one needs to know the default branch for a given Git repo. Below I have compiled methods that fit a variety of use cases, and cover specific platforms (Github and Gitlab) as well as methods that work universally regardless of remote platform. ...more

January 29, 2021 Updated: July 06, 2023 [Dev] #git #commandline

Generating a .gitignore file

The .gitignore file contains a list of filenames or patterns that should be excluded from version control. Thankfully, several resources exist to more easily guide the generation of such files. ...more

August 01, 2020 Updated: July 04, 2023 [Dev] #git