I want to clean/reset all git repositories in a directory recursively.
If I execute the following command it works as expected:
find . -name .git -type d -execdir sh -c "git clean -xdf" \;
I have problems converting the command to a git alias:
xxx = "!f() { find . -name .git -type d -execdir sh -c "git clean -xdf" ; ; }; f; "
I have tried to fix the errors such as syntax error near unexpected token
;'` however I am going in a circle with no success.
Please help me to create the alias. 10x
Here you go:
xxx = "!f() { find . -name .git -type d -execdir git clean -xdf \\; ; }; f"
A few things:
sh -c
, you can use it directly \\
in \\;
at the end of the find
command, writing as: \\\\;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.