# Howto get repository up2date after pull with touching as less as possible files in the working directory

2 messages from 2005-05-09 to 2005-05-09. Participants: Thomas Glanzmann, Petr Baudis.
Thread: https://gitlist.dev/t/552

## Thomas Glanzmann, 2005-05-09 17:49

Subject: Howto get repository up2date after pull with touching as less as possible files in the working directory
Message-ID: <20050509174951.GK24216@cip.informatik.uni-erlangen.de>
URL: https://gitlist.dev/e/20050509174951.GK24216%40cip.informatik.uni-erlangen.de

```
Hello alltogether,
at the moment I ensrure that there are no dirty files before the pull
and do a

	git-read-tree HEAD
	git-checkout -a -f
	git-update-cache --refresh

this is suboptimal because all the files in my working directory get a
new timestamp and if I call make everything is recompiled (ccache helps,
but is not the solution to this problem).

So what is the right way to touch *only* the files which are dirty. Are
there any shortcuts? Or should I call 'git dirty' pipe that to
git-checkout -f?

	Thomas

```

## Petr Baudis, 2005-05-09 18:18

Subject: Re: Howto get repository up2date after pull with touching as less as possible files in the working directory
Message-ID: <20050509181842.GA7040@pasky.ji.cz>
URL: https://gitlist.dev/e/20050509181842.GA7040%40pasky.ji.cz
In-Reply-To: <20050509174951.GK24216@cip.informatik.uni-erlangen.de>

```
Dear diary, on Mon, May 09, 2005 at 07:49:51PM CEST, I got a letter
where Thomas Glanzmann <sithglan@stud.uni-erlangen.de> told me that...
> Hello alltogether,
> at the moment I ensrure that there are no dirty files before the pull
> and do a
> 
> 	git-read-tree HEAD
> 	git-checkout -a -f
> 	git-update-cache --refresh
> 
> this is suboptimal because all the files in my working directory get a
> new timestamp and if I call make everything is recompiled (ccache helps,
> but is not the solution to this problem).

Do git-read-tree -m HEAD instead. That will keep the original stat
information and checkout will rewrite only files it needs to.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

```
