[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git: how to figure out with a script what the last commit on remote repo is without fetching it



On 06/09/14 06:04, lee wrote:
> Hi,
>
> how would I figure out what the last commit to a remote repo was without
> first fetching or pulling the remote repo?

$ git ls-remote origin

... will show you the list of references (tags, branches/heads) that
exist on the remote "origin", and what SHA1 they are currently referring
to. This is a live check actually going to the server. Works for git,
git+ssh, https, whatever protocol you are using.

$ git ls-remote origin refs/heads/master

... will show you the SHA1 that the master branch on the remote
currently points to.

-- 
   /c


Reply to: