Last active
August 22, 2019 09:42
-
-
Save Kieranties/d0f7a411af95019c56e40541d9be3897 to your computer and use it in GitHub Desktop.
Git Next - Simple alias for presenting when using a git repo - https://blog.kieranties.com/2019/04/06/git-next
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
start = "!f() { \ | |
baseTag='1'; \ | |
startTag=$1; \ | |
selectedTag=${startTag:-${baseTag:-startTag}}; \ | |
git reset --hard $selectedTag; \ | |
git clean -df; \ | |
git tag -l $selectedTag -n999; \ | |
}; f" | |
next = "!f() { \ | |
tagNum=$(git tag -l --points-at head); \ | |
nextInt=$(printf '%d' "\""$tagNum"\""); \ | |
nextTag=$((nextInt+1)); \ | |
git start $nextTag;\ | |
}; f" | |
prev = "!f() { \ | |
tagNum=$(git tag -l --points-at head); \ | |
nextInt=$(printf '%d' "\""$tagNum"\""); \ | |
nextTag=$((nextInt-1)); \ | |
git start $nextTag; \ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment