Git: Automatically moving a tag using a custom command

 |  300 words — 1 minute  |  git bash script

Ever find yourself moving a git tag to a new commit? You’ll probably know this procedure consists out of three steps;

  • Removing the existing tag from your origin
  • Manually moving the tag (using -f to allow moving)
  • Pushing the tag back your origin

Since this procedure is more cumbersome that it could be, behold, a quick and easy life hack to automate this process into a single custom command.