OT: git question -- fetch a deleted file?

Michel Dänzer michel at tungstengraphics.com
Thu Oct 5 12:25:25 PDT 2006


On Thu, 2006-10-05 at 12:49 -0500, Jeremy C. Reed wrote:
> > On Thu, 2006-10-05 at 10:57 -0500, Jeremy C. Reed wrote:
> > > I manually deleted some files in a sub directory in my xserver checkout.
> > > 
> > > I tried to do a "git pull" and a "git fetch" but the files never returned.
> > > 
> > > I am used to being able to do a "cvs up -dPA" and being able to retrieve 
> > > files I removed.
> > > 
> > > Any suggestions on how to do this with git?
> > > 
> > > I looked at the git-pull and git-fetch manual pages.
> > 
> > The whole repository is local, no need to fetch anything remote for
> > this...
> > 
> > git-checkout <files>
> 
> Thanks. That worked.
> 
> I used "git-reset HEAD" to tell me the filenames of which files were 
> missing ("needs update"). I don't know if that is the correct way.

I'd probably use git-status for that.

> Is there a way to get it to replace my missing files without me doing each 
> file at a time (like "cvs up")? (It doesn't seem like I should parse 
> git-reset output to be reused by git-checkout for this.) I see 
> git-checkout -f but I don't know if that will overwrite my changes. 

It will.

> I just want to replace all my missing files.

I'd probably use some combination of git-diff, patch -R and git-checkout
-f, but maybe there's a simpler way I'm about to learn from someone
else. :)


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer




More information about the xorg mailing list