Since a branch is more or less only a tag, that moves automatically to the new commit, I wonder if I can modify this “tag”.
Example:
master
A -- B -- C -- D
git checkout master would be the same as git checkout D
Can I change master to point to commit B?
master
A -- B -- C -- D
git checkout master would now be the same as git checkout B
Use Case
Imagine someone has pushed one single commit to the online repository. When I do git fetch, I get this commit local, but my master branch still points to the commit before, while origin/master points to the new commit. I just want to move the local master branch to the same commit as origin/master points to.
So, I wouldn’t have to merge.
Thanks for your help
This should work: