Answer the question
In order to leave comments, you need to log in
How to deploy only a commit in a remote git repository through a hook?
Good afternoon.
1) There is a local repository and a remote bare repository. Set up a post-receive hook to deploy to the working directory. When pushing in the working directory on a remote server, files not only from the commit are replaced. For example, config files. On the local server, they were first in the index, then added to gitignore, and then removed from the index (rm --cached), but are still deployed on the remote server after a commit that does not affect them.
2) The necessary rights to files and directories are also configured. After the push, everything in the index changes ownership and permissions. How can I correct or save the current rights? On chmod, I would not want to give nopassword to the user, if in a hook, for example, then change the rights back.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question