Skip to content

Instantly share code, notes, and snippets.

Avatar

Brandon Stillitano bstillitano

  • Sydney, NSW, Australia
View GitHub Profile
@bstillitano
bstillitano / move-git-tag
Last active Feb 26, 2021
Simple shell script that allows you to move a git tag without having to manually remove it. This script guides you through without requiring any knowledge of git.
View move-git-tag
#!/bin/bash
echo -e "Hi $(whoami) 👋, this script allows you to move an existing git tag to the latest commit on your current branch and then pushes it to the remote. Are you sure you want to proceed? [y/n]"
read proceedWithMove
if [ $proceedWithMove == y ] || [ $proceedWithMove == Y ]
then
echo -e "\n\nWhat directory is your git branch in? This script will cd in for you and use that as the working directory. This should be relative to the root folder of your machine. For example, if your repository is at ~/Users/Brandon/iOS then you should enter /Users/Brandon/iOS. If you're currently in the right folder, leave this blank."