Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view remote repo's lastest several commit hash using git?

Tags:

git

I want to check commit progress between the remote and the locale and don't want to open the repo url in browser.

In some case, I want to watch repo's dev branch's lastest 3 commit hash and their commit detail.Can git do it?

Command should be like

git log remote origin dev --depth 3

like image 988
fwhez Avatar asked Dec 03 '25 15:12

fwhez


1 Answers

To see what's happening on the remote, you'll want to fetch the latest commits. This will let you keep your local branch and the remote branch's history separate.

$ git fetch origin

Logging will show you the last three commits on you the branch you're interested in:

$ git log origin/dev -n 3
like image 50
Jake Worth Avatar answered Dec 06 '25 06:12

Jake Worth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!