Skip to content

Instantly share code, notes, and snippets.

@Kieranties
Last active August 22, 2019 09:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kieranties/d0f7a411af95019c56e40541d9be3897 to your computer and use it in GitHub Desktop.
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
[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