• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Archives for command line

command line

Git Change Remote to https

Last updated on July 28, 2026 by Sal Ferrarello

I had to change a bunch of Git remotes from GitHub SSH URLs (e.g. git@github.com:salcode/salcode-zsh.git) to GitHub https URLs (e.g. https://github.com/salcode/salcode-zsh.git) on a bunch of different repos. This is how I made it easier for myself.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, GitHub

xargs: warning: options –max-args and –replace/-I/-i are mutually exclusive, ignoring previous –max-args value

Last updated on August 1, 2025 by Sal Ferrarello

This threw me for a loop so I’m writing this down to help others (and likely me in the future). I swear I’ve used “xargs” with both “-I” and “–max-args” in the past but now I’m getting this warning and things are behaving improperly. It turns out there are two version of xargs, (FreeBSD xargs and GNU xargs). FreeBSD xargs is installed on BSD systems (including MacOS) and GNU xargs is found on on Linux systems. This warning (and the incorrect result you also get) indicate you’re running GNU xargs.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, xargs

Git Editor Roulette

Last updated on July 4, 2025 by Sal Ferrarello

A question came up about setting the Git editor to a bash function, which I could not figure out. I was, however, able to set the Git editor to a bash script. As a proof of concept, here is a bash script to randomly choose an editor (nano or vim) when using Git.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, git log

Git Squash Back To

Last updated on July 31, 2025 by Sal Ferrarello

Often in my work, I’ll create a number of commits before I craft my correct solution. Having these missteps in separate commits doesn’t provide any real value and adds noise so I’ll often squash these commits into a single commit. Historically, I’ve used a Git interactive rebase to do this but as I was reminded on Mastodon, it seems like there should be a quicker way, so I’ve created a Git alias, “git squashbackto”, to do this.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, git alias, rebase, vim

Get GitHub PR Number from Current Branch

Last updated on June 3, 2025 by Sal Ferrarello

When scripting a task using the GitHub CLI, I found I needed the Pull Request (PR) number for my current branch (technically my current commit). I was able to use “gh pr view” to get the information.

Filed Under: Computing, Dev Tips, Solution Tagged With: bash script, command line, GitHub, GitHub CLI

GitHub Bypass Failed Status Check

Last updated on August 6, 2024 by Sal Ferrarello

Sometimes a GitHub status check fails and you want to override it so you can still merge your PR.

Filed Under: Dev Tips, Solution Tagged With: command line, GitHub

Convert Markdown to Plaintext

Last updated on January 9, 2024 by Sal Ferrarello

I recently had to convert some markdown into plaintext and rather than use an online tool I wanted to do it locally. This is the solution I found.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Markdown

Git Alias Can Not Change Directory

Last updated on December 1, 2023 by Sal Ferrarello

I wanted to add a Git alias that does a “git clone” and then “cd” to change into the new directory. However, while the “git clone” worked fine, the directory change did not. It turns out you can NOT change directories from within a Git alias.

Filed Under: Computing, Dev Tips Tagged With: command line, Git, git alias, zsh

cd in script without polluting previous directory

Last updated on October 5, 2023 by Sal Ferrarello

I wanted to write a shell alias to get the Git status of a specific directory (~/code/projectx). How could I change directories without polluting the previous directory? (so ‘cd -‘ still works as it did before I ran my alias)

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, zsh

Notify When Command Completes

Last updated on October 10, 2023 by Sal Ferrarello

When I kick off a long running process on a project (e.g. “npm install”) and I shift my focus somewhere else, I often get absorbed in my other task and don’t return to the original process as soon as I wanted to. I’ve addressed this in the past by setting a timer to remind me to come back and check. More recently, I’ve started adding a audio notification to tell me when the task is completed.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line

  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Next Page»

Copyright © 2026 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in