[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: How to check repository/working tree status from a script
From:       Marc Haber <mh+git () zugschlus ! de>
Date:       2009-05-19 16:00:31
Message-ID: 20090519160031.GB23505 () torres ! zugschlus ! de
[Download RAW message or body]

Hi Tony,

On Tue, May 19, 2009 at 04:34:47PM +0100, Tony Finch wrote:
> On Tue, 19 May 2009, Marc Haber wrote:
> > I would like to check in a script whether there (a) are uncommitted
> > changes (as in "working tree differs from local repository")
> 
> # check working tree is not different from the index
> git diff --quiet
> # check that the index is not different from the head
> git diff --quiet --cached

$ git diff --quiet; echo $?
0
$ git diff --quiet --cached; echo $?
0
$ touch keks
$ git diff --quiet; echo $?
0
$ git diff --quiet --cached; echo $?
0
$

Am I missing something?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic