diceline-chartmagnifiermouse-upquestion-marktwitter-whiteTwitter_Logo_Blue

Today I Learned

Git delete all tags

Used to mark specific commits on git and often used to mark product releases on Github, git tags are important. But sometimes, you just need to delete them.

Here's a simple way to do that:

  • Delete all remote tags
git tag -l | xargs -n 1 git push --delete origin
  • Delete local tags
git tag | xargs git tag -d
  • Check if any tags are left
git tag

Use F12 as "Insert" in macOS terminal

On Apple keyboards we don't have an Insert key, and this is most annoying when using the command line or CLI tools like Midnight Commander.

We can fix this by re-assigning the F12 key:

  • Remove F12 as key from System Settings->Mission Control
  • Enable Use F1, F2, etc. keys as standard function keys in System Settings->Keyboard->Keyboard
  • Go to Terminal->Preferences and set the default profile as Pro
  • Go to Terminal->Preferences->Profiles->Keyboard and Replace F12 code with \033[2~

Make macOS remember your SSH keys after restart

We need to tell macOS to add the keys to the agent, in order to make them persistent after reboot.

We have to create new file in ~/.ssh/ called config

vi ~/.ssh/config

with the following content:

Host *
   AddKeysToAgent yes
   UseKeychain yes   

Then, we need to add our keys to the agent and macOS keychain (so your private key password is remembered).

ssh-add -D
ssh-add -K ~/.ssh/*

To verify that our keys are present in the agent:

ssh-add -l