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

Solution

Shampoo Bottle Protocol

Last updated on May 15, 2021 by Sal Ferrarello

One day I realized that the last 10% of the shampoo bottle lasted at least as long as the first 90%. I suspected this was because most of the time I was using too much shampoo but as I neared the end of the bottle I used a more appropriate amount. How could I trick my brain to always use the appropriate amount?

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Happy, Solution Tagged With: lifehack

Remove newline at end of text file

Last updated on February 10, 2022 by Sal Ferrarello

Sometimes when I’m working with files in Git, I find myself with a change in a file that says “No newline at end of file”. This occurs when my editor adds the missing newline at the end of the file. While you should have a newline at the end of the file, you may have a reason for not wanting to add this change. In that case, you can remove the newline from the end of the file.

Warning! This is a draft, not a finalized post. See full draft disclosure.

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

Git alias 'git open-pr-github' and the webpage it opens to.

Git Alias Open Pull Request on GitHub

Last updated on December 1, 2022 by Sal Ferrarello

I want to be able to type “git open-github-pr” and have my browser open to the GitHub URL to create a Pull Request (PR) for my current branch on the current project I’m working on. Here is how I built this.

Filed Under: Dev Tips, Solution Tagged With: Git, git alias, GitHub

Your edited hunk does not apply

Last updated on March 24, 2021 by Sal Ferrarello

When using git add -p and faced with a hunk that can not be split sufficiently for your purposes, you can use the e option (manually edit the current hunk). Unfortunately, after manually editing the current hunk it is common to get the message “Your edited hunk does not apply.” I’ve found there are some things I can do to avoid this failure.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

Resolving Git Rebase Merge Conflicts

Last updated on February 2, 2021 by Sal Ferrarello

When performing a Git rebase, I often find myself in the situation where I have one or more merge conflicts. This is how I resolve these merge conflicts.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git, Merge Conflict, rebase

WP CLI Migrate User Roles

Last updated on December 17, 2020 by Sal Ferrarello

Recently on a project I wanted to migrate WordPress users with a certain role to a different role. This is the command I used.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: WordPress, wp-cli

Hand holding a fishing rod on a river.

Recover failed Git commit message

Last updated on March 13, 2021 by Sal Ferrarello

When you are using Git commit validation (a.k.a. commit linting) and it fails, it is frustrating to re-type your message. Git stores the commit message that failed validation. You can use this stored message to start your new commit message.

Filed Under: Dev Tips, Solution Tagged With: Git, git alias

There is no tracking information for the current branch.

Last updated on November 12, 2022 by Sal Ferrarello

When working with Git and you run “git pull” sometimes you get the error message, “There is no tracking information for the current branch.” You can fix this by running a command to set your local branch to track the origin branch of the same name.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

Add git status to zsh prompt

Last updated on December 29, 2020 by Sal Ferrarello

One of the things that made me much better at Git was making my current branch (and whether or not I have any changed files) always visible. By default zsh includes everything you need to do this, you just need to configure it.

Warning! This is a draft, not a finalized post. See full draft disclosure.

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

Git branch list without asterisk

Last updated on October 6, 2020 by Sal Ferrarello

By default “git branch” will list all of your local branches with an asterisk in front of the current branch. We can remove the asterisk and list only the branch names by adding the “format” parameter.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Interim pages omitted …
  • Go to page 15
  • Next Page»

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