Updating a Git branch that is not checked outEdit
If you're on branch foo and want to make branch bar point at the HEAD of foo without having to first checkout bar, you can use:
$ git branch -f bar HEAD
Note that HEAD is actually the default, so the above can be simplified to:
$ git branch -f bar