User Tools

Site Tools


ubuntu:git:relative_refs

Ubuntu - GIT - Relative Refs

You could use relative refs to move branches around. e.g., git branch -f master HEAD~3, etc.

The “^” Operator goes up to the first parent.

git checkout master^

The “~[integer]” Operator specifies the number of parents you would like to ascend to.

# Goes up 4 parents from HEAD.
git checkout HEAD~4 
ubuntu/git/relative_refs.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki