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?
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 .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With