hacene182 / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

FEATURE: repo "revert" #123

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
k, I gave up looking up the code to figure out how it was working

can you at least advice how can I edit it to implement this?

v1:src zeph$ for prj in `repo-1.18 status|grep project|awk '{print $2}'`; do 
pushd $prj; for f in `git status|grep modified|awk '{print $3}'`; do git 
checkout -- $f; done ; popd; done

regards,
G.

Original issue reported on code.google.com by guido.se...@rocket-internet.de on 15 Nov 2012 at 10:01

GoogleCodeExporter commented 8 years ago
You can use `repo forall` to iterate over all projects, and the -c option to 
execute the same command on all of them in turn.

To find all modified files on a git, you can use `git ls-files --modified`

So assuming you want to revert changes on all files, you can do:

 $ repo forall -c 'for f in `git ls-files --modified`; do echo $f; git checkout -- $f ; done'

Original comment by david.pu...@sonymobile.com on 22 Nov 2012 at 10:34

GoogleCodeExporter commented 8 years ago
I c... thanks David

Original comment by guido.se...@rocket-internet.de on 26 Nov 2012 at 9:39

GoogleCodeExporter commented 8 years ago

Original comment by david.pu...@sonymobile.com on 30 Nov 2012 at 12:40