• 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 Computing

Computing

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

Git matched multiple remote tracking branches

Last updated on October 24, 2023 by Sal Ferrarello

Sometimes when I run a command like “git checkout chore/fix-typo”, I get an error message like “fatal: ‘chore/fix-typo’ matched multiple (2) remote tracking branches”. We can configure Git to avoid this error by defaulting to the “origin” remote.

Filed Under: Computing, Dev Tips, Solution Tagged With: Git, gitconfig

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

Find dependency in composer.json with jq

Last updated on October 1, 2023 by Sal Ferrarello

Sometimes I need the full Composer dependency name but I only know part of it. For example, I may know Block X-ray Attributes is a Composer dependency but I don’t remember the full package name. While I could open the composer.json file and find the dependency, I can also leverage jq to do the work for me.

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

My Most Valuable Git Aliases are Shell Aliases

Last updated on September 24, 2023 by Sal Ferrarello

While Git supports aliases and I am a big fan of Git aliases, (e.g. ‘git lg’), the most valuable to me (and most used) aliases are shell aliases (e.g. ‘gc’ for ‘git commit’).

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

Git Rebase and the Multiverse

Last updated on September 17, 2023 by Sal Ferrarello

In “Git Merge and the Multiverse” I looked at merging branches and how sometimes this results in a fast-forward merge and sometimes in the creation of a merge commit. Now let’s look at Git rebase (a.k.a. the power to rewrite history).

Filed Under: Computing, Dev Tips, Programming Tagged With: Git, rebase

Git Merge and the Multiverse

Last updated on September 17, 2023 by Sal Ferrarello

If you’re a fan of science (or science fiction), you may be familiar with the concept of the “Multiverse”, the idea that there are multiple universes. In some science fiction stories, one universe can split, branching into multiple universes and then later collapse into a single universe, this is a surprisingly good analogy for Git and branching.

Filed Under: Computing, Dev Tips, Programming Tagged With: Git

Set Number of Characters in Commit Hash for git log

Last updated on December 6, 2023 by Sal Ferrarello

When I’m writing examples, it is often nice to have very short commit hashes. The ‘–abbrev=4’ argument, passed after the ‘–oneline flag, allows me to reduce the number of characters in the commit to 4.

Filed Under: Computing, Dev Tips Tagged With: Git

GitHub Link to Commit instead of Branch

Last updated on August 15, 2023 by Sal Ferrarello

When linking to specific lines in a file to GitHub, it is preferable to link to those lines in the file for a specific commit (rather than for a specific branch). This is because the contents of a branch can change but the contents of a commit remain the same forever.

Filed Under: Computing, Dev Tips, Recommendations Tagged With: GitHub

  • «Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Interim pages omitted …
  • Page 14
  • Next Page»

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