How to discard changes using repo

Johnny picture Johnny · Feb 16, 2011 · Viewed 63k times · Source

repo status shows me a lot of un-wanted changes.

It would be duplicated if I enter every project and use git reset --hard.

Is there a way to reset all the changes using repo, something like repo reset --hard?

Answer

stdcall picture stdcall · Aug 7, 2013

This is the command I use for this kind of things, very useful

repo forall -vc "git reset --hard"

What everything mean here ?

the repo forall will execute for all repos.

the -v is verbose, so it will print the output of the command

the -c "COMMAND TO EXECUTE" is the actual command you want