ansible-role--bashrc/files/bashrc.d/70-util-git.sh

14 lines
313 B
Bash
Raw Normal View History

2021-12-31 12:03:38 +00:00
# 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~'