Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git checkout next commit

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #checkout #commit
ADD COMMENT
Topic
Name
6+8 =