Skip to content

Instantly share code, notes, and snippets.

@seancaffery
Created March 18, 2013 23:58
Show Gist options
  • Save seancaffery/5192212 to your computer and use it in GitHub Desktop.
Save seancaffery/5192212 to your computer and use it in GitHub Desktop.
Generate tags file when changing git branches
#!/bin/sh
old_ref=$1
new_ref=$2
changing_branch=$3
if [[ $changing_branch == 1 && $old_ref != $new_ref ]]
then
/bin/echo -n 'Generating tags file...'
ctags -R 2> /dev/null
/bin/echo 'done!'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment