[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 2014-09-06 16:42 +0200, lee wrote:

> When I run 'git diff', I don't get any output unless I have made local
> changes which aren't committed yet.  I'm not sure about 'git status':
>
>
> [~/inst/emacs/emacs-git/emacs] git status
> On branch master
> Your branch and 'origin/master' have diverged,
> and have 9 and 51 different commits each, respectively.
>   (use "git pull" to merge the remote branch into yours)
>
> Untracked files:
> [...]
>
>
> I have not made 9 commits to my local copy, so this is a confusing
> message (but IIRC I did run 'git fetch' earlier to see if I could get
> any useful info).

Even if you have not made any local changes, such things happen if the
remote branch has been rebased.

> I'd find it hard to believe that there is no reasonable way to check for
> new commits that have been made to a remote repo.  Git can't be that
> bad, can it?  (Running 'git diff' for this is not reasonable, and
> keeping multiple copies of repos isn't, either.)

How about "git fetch --dry-run"?

Cheers,
       Sven


Reply to: