Skip to content

Instantly share code, notes, and snippets.

@mijdavis2
mijdavis2 / pre-commit
Last active June 2, 2021 21:18 — forked from jcromartie/pre-commit
Git pre-commit hook to help stay up-to-date with master
#!/usr/bin/env bash
# hook to enforce that current branch is up-to-date with latest
# changes from master before committing
# put me in .git/hooks and make me executable
# the output of rev-list in the following test will be empty if there
# are no commits in master that aren't in the current branch
@mijdavis2
mijdavis2 / remove-v-from-git-tags.sh
Last active May 15, 2018 16:11 — forked from ahmednuaman/remove-v-from-git-tags.sh
Remove the v from git tags
# Fetch
git fetch
# Create tags without v from tags that start with v
for tag in $(git tag)
do
if [[ $tag =~ ^v.*$ ]]
then
git tag "${tag/v/}" $tag
fi