Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get commit logs/messages of a remote git repo without git clone

Is it possible to get commit logs/messages of a remote git repo without git clone?

The git repo I am working with is huge, even if I run git clone with --depth=1 still takes sometime before I am able to clone it.

I am looking for something like this,

git remote-log .

I have also looked in to git -ls-remote, which only provides the SHA and the Heads/tags. I am interested in getting the last 2 commit title, commit user and commit SHA?

Anyone know how to do that?

like image 783
Murtaza Pitalwala Avatar asked Nov 18 '13 18:11

Murtaza Pitalwala


People also ask

How do I pull a commit from a remote?

The short answer is: you cannot pull a specific commit from a remote. However, you may fetch new data from the remote and then use git-checkout COMMIT_ID to view the code at the COMMIT_ID .

Does git clone copy commit history?

Each clone usually includes everything in a repository. That means when you clone, you get not only the files, but every revision of every file ever committed, plus the history of each commit.

What is the command to get all the change history of the remote repository?

The git fetch command downloads commits, files, and refs from a remote repository into your local repo. Fetching is what you do when you want to see what everybody else has been working on.


1 Answers

If you are looking to see the last few commits of a branch, try:

git clone -b [branch name] --single-branch [repo url] --depth=3 

This will clone only the last 3 commits on the branch you are interested. Once done you can get into the cloned repo and view the history.

like image 99
Noob Avatar answered Sep 22 '22 19:09

Noob