Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT: I want to unstage all files matching a certain pattern

I would like to run

git reset *.foo

but this errors out.

I think I need to use a pipe, but I'm not sure how to do this.

Thanks!

like image 221
Jacko Avatar asked Nov 19 '10 18:11

Jacko


2 Answers

If you are using Powershell the following will work.

gci -re -in *foo | %{ git reset $_ } 
like image 124
JaredPar Avatar answered Sep 19 '22 12:09

JaredPar


You can try restore the files with git restore '*.foo'

like image 36
César Noreña Avatar answered Sep 18 '22 12:09

César Noreña