Skip to content

Instantly share code, notes, and snippets.

View frederikheld's full-sized avatar
👨‍💻
Feeling cody. Might revert later. IDK.

Frederik Held frederikheld

👨‍💻
Feeling cody. Might revert later. IDK.
View GitHub Profile
@frederikheld
frederikheld / create-releases-from-old-commits.md
Created October 4, 2023 12:45
Create releases from old commits

If you create a new release in GitHub, you will either create a new tag (which will point to the most recent commit on main) or choose an existing tag (that might point to an older commit).

If you want to create releases from old commits (e.g. because you forgot to create a realease or didn't work with releases back then), there is a problem with this: when creating a tag for a specific commit in the past, GitHub only lets you pick from the most recent commits, so the commit you want to tag will not show up in the list.

Luckily, you can tag older commits locally [1]:

  1. Find the commit on GitHub. If it is from a Pull Request, you can look into the closed Pull Requests. Within the PR you'll find a link to the commit.
  2. Copy the commit hash from yo
@frederikheld
frederikheld / check-sudo.sh
Created May 8, 2023 22:49
Make sure that script is being run as sudo
#!/bin/sh
if [ "$(id -u)" -ne 0 ]
then
echo "This scripts needs elevated privileges. Please run as sudo!"
echo "Correct usage:"
echo " $ sudo sh $(basename "$0")"
exit 1
fi