I have a parent directory and inside that directory there are multiple sub-directories which contain .git directories consisting of objects.
How do I run 'git checkout -f .' recursively for each sub-directory?
Can use the following command inside parent directory
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} checkout -f \;
maxdepth 1
- looks only for subdirectories
type d
- looks only for directory type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With