Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the version of Git repo

I cloned a git repository yesterday and am using it in Ubuntu. I need to find the version of that cloned repository I am using. What is the command for that?

like image 869
yolo Avatar asked Oct 18 '25 14:10

yolo


2 Answers

You can use the more common git log -1 or the less used git rev-parse HEAD

like image 120
Neeraj Bansal Avatar answered Oct 21 '25 04:10

Neeraj Bansal


If you have not pushed yes, you can check the version of origin/master, or of FETCH_HEAD (see FETCH_HEAD)

cd /path/to/your/local/cloned/repo
git rev-parse origin/master
git rev-parse FETCH_HEAD

That will give you the commit ID (SHA1) of what was last fetched.

like image 23
VonC Avatar answered Oct 21 '25 04:10

VonC



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!