Skip to content

Instantly share code, notes, and snippets.

View chuckntaylor's full-sized avatar

Charles Taylor chuckntaylor

View GitHub Profile
chuckntaylor /
Last active July 19, 2024 13:48
Git: Rename local and remote branch

Renaming both a local and remote branch

First, rename the local branch by typing:

git branch -m <old_name> <new_name>

Then push the new branch to the remote repository:

chuckntaylor /
Last active April 10, 2024 13:39
Git branch commands

Common Git Branch Commands

A collection of git commands that I commonly use, but can never remember.

Pushing a new branch to a remote repository

git push -u origin branchName
chuckntaylor /
Last active April 5, 2024 15:04
Closing a port

How to close a port on Mac

In Terminal, type the following command to find the process ID (PID) of the port. Replace PORT_NUMBER with the actual port number you want to close.

sudo lsof -i :PORT_NUMBER

Copy the PID number, then use the following command to kill the process using the PID you found.

chuckntaylor /
Last active November 16, 2021 02:39
Remove GPG Yubikey, and enable another one

[OPTIONAL] list the keygrip IDs using

gpg --list-secret-keys --with-keygrip

If ALL your private keys are on external cards like the Yubikey, you can delete them all using:

rm -r ~/.gnupg/private-keys-v1.d