OT: git question -- fetch a deleted file?

Josh Triplett josh at freedesktop.org
Sat Oct 7 22:30:17 PDT 2006


Michel Dänzer wrote:
> 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. :)

I'd personally use git status, grep (for removed files), and git checkout.

- Josh Triplett

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20061007/02d4a270/attachment.pgp>


More information about the xorg mailing list