I am originally an SVN user.
In Git, git log shows only the log from the current commit.
How can I get the log from HEAD?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get log from server-side HEAD, you need to fetch changes from the server first. Unlike
pull,fetchis not going to affect your working tree. So, it’s safe.git fetch originHere
originis your remote repo. This command fetches the latest data from the remote repo.git log origin\masterHere
origin\masterimpliesmasterbranch in the remote repoorigin. This command shows log fromorigin\master.Other useful
git logoptions:i)
git log HEAD..origin\masterShow the commits that are in the “origin/master” branch but not yet in the “HEAD”.
ii)
git log -p HEAD..origin\masterShow the commits as a patch.
iii)
git log -5Shows the latest 5 commits.