How can I check with the command line the latest commit hash of a particular Git branch?
In a comment you wrote
i want to show that there is a difference in local and github repo
As already mentioned in another answer, you should do a git fetch origin
first. Then, if the remote is ahead of your current branch, you can list all commits between your local branch and the remote with
git log master..origin/master --stat
If your local branch is ahead:
git log origin/master..master --stat
--stat
shows a list of changed files as well.
If you want to explicitly list the additions and deletions, use git diff
:
git diff master origin/master