I had seen many developers cloning our repo and committing their changes to the master branch of their cloned repo, They are not following the git branched workflow. Developers that are not familiar with using git may get into this problem and may end up with an unclean master branch.
AFAIK we can use git server server side hook to make it possible: https://git-scm.com/book/gr/v2/Customizing-Git-An-Example-Git-Enforced-Policy
We cant use client side hooks since they are not persistent while cloning: https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks#_client_side_hooks
What is your opinion @duckduckgo/community-leaders?
I will be happy to implement this one if you are interested 馃槃. I am new to git hooks, please correct me if i had any mistakes.
@gautamkrishnar Unfortunately Github doesn't let you use server-side hooks.
It might be a job for Danger, I know we've explored using it in the past. We could also start with emphasizing the git checkout -b step in the docs more.
I remember talking about introducing pre-commit hooks in one of the mails. They will surely help avoid accidental errors, linting code, making custom checks and much more before creating a commit. This can be done on client side. Although one can bypass them if they want to, it will help reduce the number of incidents.
We cant use client side hooks since they are not persistent while cloning: https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks#_client_side_hooks
This might add a few steps on client side where we would need to set it up after cloning the repo.
I'm going to close this and add it to the community leader call agenda for this thursday. I think we may actually conclude this there: https://forum.duckduckhack.com/t/meeting-june-2017/2048/3
Most helpful comment
@gautamkrishnar Unfortunately Github doesn't let you use server-side hooks.
It might be a job for Danger, I know we've explored using it in the past. We could also start with emphasizing the
git checkout -bstep in the docs more.