Skip to content

Instantly share code, notes, and snippets.

@Pelirrojo
Created September 21, 2020 16:52
Show Gist options
  • Save Pelirrojo/3b182aa26d4257485c14d5cb902b2fc5 to your computer and use it in GitHub Desktop.
Save Pelirrojo/3b182aa26d4257485c14d5cb902b2fc5 to your computer and use it in GitHub Desktop.
Fix file permissions on git repo after losing (moving onto an usb or similar)
#!/bin/bash
# Put 644 to files & 755 for directories
find ./project \( -type f -execdir chmod 644 {} \; \) -o \( -type d -execdir chmod 755 {} \; \)
# Make bash scripts executable
chmod +x ./**/*.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment