A quick tutorial showing you how to ensure that new files created in your file structure will inherit the existing user and groups (no matter which user creates the new files). This tutorial is for Debian/Ubuntu and Mac:
Say you have a folder where you have different users accessing it and creating files and folders, such as a web directory, you don’t want each new file being assigned the different users permissions. For example, you may have a Git repository in a folder owned by Apache. If the Git is being run by a different user than the Apache user (which is more secure) then new files pulled into the Git repo will not be accessible by the Apache user. Which is not what you want.
Here is a quick command to run on the folder to set the group ownership of the folder (skip this step if the group ownership is already set)
chown -R user:group /path to folder
Then run the following command to ensure the new files and folders created inherit the default permissions (AKA the sticky bit)
chmod g+s /path/to/folder