Skip to content

Instantly share code, notes, and snippets.

View PiDayDev's full-sized avatar

Damiano Salvi PiDayDev

View GitHub Profile
PiDayDev /
Created October 2, 2019 06:03
Delete all tags from a local and remote GIT repository
# NOTE: use with caution - this will PERMANENTLY delete ALL tags from your repository
# git tag -l ==> list all tags
# | awk ...... ==> for each TAG_NAME, print the line "git tag -d TAG_NAME && git push --delete origin TAG_NAME"
# (the first command deletes local tag, the second deletes remote tag)
# | sh ==> execute each command printed by awk
git tag -l | awk '{print "git tag -d " $0 " && git push --delete origin " $0}' | sh
PiDayDev /
Last active October 8, 2023 18:16
Partial cherry-pick
#!/usr/bin/env bash
# Usage: ./cherry-pick <commit SHA or tag>
# It will cherry-pick given commit, but will only commit files in "src/" folder, skipping the rest.
# Bonus: the commit message and authorship information including the timestamp are copied from cherry-picked commit
# Credits to
git cherry-pick -n $1
git reset HEAD
git add src/