Skip to content

Instantly share code, notes, and snippets.

@ryanemmm
ryanemmm / git-retag.bash
Last active May 22, 2023 17:34
move a git tag to HEAD
# bash/zsh
##
# git-retag.bash
# ** you're proabably not supposed to do this **
# move an existing tag from <old commit> to HEAD
#
# use it like this: `retag <tagname>`
#
@ryanemmm
ryanemmm / pimp_prompt.sh
Created September 15, 2019 18:31 — forked from jamiew/pimp_prompt.sh
put this in your .bashrc/.bash_profile... works with both git and svn
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"