Can I move the .git directory for a repo to it’s parent directory?

You can do what you are describing like this: Move the content of ABC to an ABC/ subdirectory, and fix the history so that it looks like it has always been there: $ cd /path/to/ABC $ git filter-branch –index-filter \ ‘git ls-files -s | sed “s-\t-&ABC/-” | GIT_INDEX_FILE=$ \ git update-index –index-info && mv $ … Read more

Linux: Set permission only to directories [closed]

chmod can actually do this itself; the X symbolic permission means “execute, if it makes sense” which generally means on directories but not files. So, you can use: chmod -R u=rwX,go=rX /path/to/htdocs The only potential problem is that if any of the plain files already have execute set, chmod assumes it’s intentional and keeps it. … Read more

rsync prints “skipping non-regular file” for what appears to be a regular directory

Are you absolutely sure those individual files are not symbolic links? Rsync has a few useful flags such as -l which will “copy symlinks as symlinks”. Adding -l to your command: rsync -rtvpl /source/backup /destination I believe symlinks are skipped by default because they can be a security risk. Check the man page or –help … Read more

How to list all subdirectories in a directory

Use Directory.GetDirectories to get the subdirectories of the directory specified by “your_directory_path”. The result is an array of strings. var directories = Directory.GetDirectories(“your_directory_path”); By default, that only returns subdirectories one level deep. There are options to return all recursively and to filter the results, documented here, and shown in Clive’s answer. Avoiding an UnauthorizedAccessException It’s … Read more