📅  最后修改于: 2022-03-11 14:51:40.115000             🧑  作者: Mango
git checkout $(git rev-list --topo-order HEAD..towards | tail -1)
# where towards is a SHA1 of the commit or a tag.
Example: git checkout $(git rev-list --topo-order HEAD..main | tail -1)
# Will move 1 commit towards the last commit of the main branch