pengguang001 pengguang001 - 1 month ago 9
Git Question

How to fast-forward a branch to head?

I switch to master after develop on a branch for a long time. The log shows:


Your branch is behind 'origin/master' by 167 commits, and can be fast-forwarded.


I tried:

git checkout HEAD


It has no effect. This is cause because that I have checkout out an intermediate commit on master.

How to make master stay on head?

Answer Source

Doing:

git checkout master
git pull origin

will fetch and merge the origin/master branch (you may just say git pull as origin is the default).