Pragmatism in the real world

Stash unstaged changes in git

I wanted to stash just the unstaged changes in my git repo. There's a git stash –staged which will stash the staged files, but I didn't see an equivalent to stash just the unstaged ones. Obviously, this is a common problem so a minute or two of googling will find the Git stash uncached: how to put away all unstaged changes? Stack Overflow question. Turns out that you have to remember the the staging area… continue reading.

Command line access to the Mac Keychain with keyring

While reading Alex Chan's post about experimenting with the Flickr API, I noticed the call out to keyring by Jason Coombs for accessing the macOS Keychain. The built-in app: security The built-in way to access the keychain from the command line is /usr/bin/security: To create a password: $ security add-generic-password -s FlickrAPI -a rodeo -w redacted-key Note that you need to include the password on the command line in clear test, so it's now in… continue reading.

Context specific history at the bash prompt

One change I made recently to my .profile is this: # up & down map to history search once a command has been started. bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' These two bind command change the way that the up and down arrow keys work once you start typing a command to only search the history for lines that start with what you've typed so far. This means that I type, say, git and then press ↑… continue reading.