I want the output of git log
of a git repository but I don't want to have to clone the entire repository.
I.e. I want something semantically like the following
git log [email protected]:username/reponame.git
If there is a way to do this I'll also want the same for git whatchanged
If github provides a simple solution for this I would be willing to restrict myself to only git repositories hosted on github.
You should fetch the remote branch then interact with it. git fetch
will pull the remote branch into your local repository's FETCH_HEAD, but not your working directory.
git log FETCH_HEAD --decorate=full
will let you see where your HEAD is in comparison to refs/origin/HEAD, which is the remote branch.
git whatchanged FETCH_HEAD --decorate=full
is the same as above, but also shows the files that have changed.
git diff HEAD FETCH_HEAD
diffs between your repository's HEAD and the remote branch's HEAD that you just fetched
git diff --stat HEAD FETCH_HEAD
a summary preview of the changes, just as you would see during the merge and at the bottom of a git pull.
Note that if you do wish to pull in the fetched changes, just do a git merge FETCH_HEAD
. (When you git pull
you are essentially just doing a fetch then a merge)
You could do a shallow clone, which would limit the amount of stuff you'd have to fetch if you only need the recent history:
git clone --depth 100 ...
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