# "p4 revert -a" equivalent in git?

3 messages from 2005-12-24 to 2005-12-24. Participants: Luben Tuikov, Junio C Hamano.
Thread: https://gitlist.dev/t/2919

## Luben Tuikov, 2005-12-24 00:13

Subject: "p4 revert -a" equivalent in git?
Message-ID: <20051224001308.7078.qmail@web31805.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20051224001308.7078.qmail%40web31805.mail.mud.yahoo.com

```
Hi,

Is there a "p4 revert -a" equivalent in git or should I
whip up a script using git-diff-index and git-update-index?

That is I want to git-update-index --refresh for all
files whose inode may have changed but the actual file
data has not (i.e. git-diff-index is empty).

Thanks,
   Luben

```

## Junio C Hamano, 2005-12-24 00:23

Subject: Re: "p4 revert -a" equivalent in git?
Message-ID: <7vd5jn4a36.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd5jn4a36.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20051224001308.7078.qmail@web31805.mail.mud.yahoo.com>

```
Luben Tuikov <ltuikov@yahoo.com> writes:

> That is I want to git-update-index --refresh for all
> files whose inode may have changed but the actual file
> data has not.

That's what "git-update-index --refresh" does, unless I am
misreading what you say you want.

	$ git checkout master
        $ touch *.c
	$ git diff-index HEAD ;# tons of changes
        $ git update-index --refresh
	$ git diff-index HEAD ;# no changes

```

## Luben Tuikov, 2005-12-24 00:36

Subject: Re: "p4 revert -a" equivalent in git?
Message-ID: <20051224003615.47349.qmail@web31807.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20051224003615.47349.qmail%40web31807.mail.mud.yahoo.com
In-Reply-To: <7vd5jn4a36.fsf@assigned-by-dhcp.cox.net>

```
--- Junio C Hamano <junkio@cox.net> wrote:
> That's what "git-update-index --refresh" does, unless I am
> misreading what you say you want.
> 
> 	$ git checkout master
>         $ touch *.c
> 	$ git diff-index HEAD ;# tons of changes
>         $ git update-index --refresh
> 	$ git diff-index HEAD ;# no changes

Ok, thanks.  I wasn't sure if I had to specify the file
names on the command line of "git-update-index --refresh".
It looks like I don't have to, so this is a perfect
equivalent.

Thanks,
   Luben

```
