File permissions for Linux when editing in Windows

Posted on

File permissions for Linux when editing in Windows – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, windows, filesystems, docker, .

What I want is to move my development from Linux to Windows, using Docker’s Tools (Kinematik, Machine, Compose). I’m still developing web applications supposed to be running on Linux in production, of course.

Easy part is to install Tools and clone a repo. This way repo with a source code is in Window’s host file system, but running in Linux via containers.

Difficult part is when I edit files, save it back and commit via git, the file’s permission is 0777 and it doesn’t respect existing (before editing) permissions.

How it could be sorted?

Solution :

Change you umask settings, typically umask should be 022 (so files are 644 and folders are 755)

For SFTP change it here:

How to put desired umask with SFTP?

You may find some ideas here https://stackoverflow.com/questions/6476513/git-file-permissions-on-windows-7 None of them seem exactly what you are saying, but taken together, you may find something that works for you.

Leave a Reply

Your email address will not be published.