ansible-role--bashrc/files/bashrc.d/70-util-git.sh
2021-12-31 13:03:38 +01:00

14 lines
313 B
Bash

# Go forward in Git commit hierarchy, towards particular commit
# Usage:
# gofwd v1.2.7
# Does nothing when the parameter is not specified.
gitfwd() {
git checkout "$(git rev-list --topo-order HEAD.."$*" | tail -1)"
}
# Go back in Git commit hierarchy
# Usage:
# goback
alias gitback='git checkout HEAD~'