To get the log on the server side of HEAD, you must first get the changes from the server. Unlike pull , fetch will not affect your working tree. Therefore, it is safe.
git fetch origin
Here origin is your remote repo. This command retrieves the latest data from a remote repo.
git log origin\master
Here, origin\master means the master branch in the remote origin repo. This command shows the log from origin\master .
Other useful git log options:
i) git log HEAD..origin\master
Show commits that are in the "origin / master" branch but not yet in the "HEAD" branch.
ii) git log -p HEAD..origin\master
Show commit as a patch.
iii) git log -5
Shows the last 5 commits.
source share