nicolaiklokmose
nicolaiklokmose
JCHJava Community | Help. Code. Learn.
Created by nicolaiklokmose on 1/18/2025 in #java-help
Blocking/Preventing certain GIT actions on repositories
I've implemented a combination of Git Hooks both client side and server side to prevent the merging between specific branches. As of right now, the server side pre-receive hook is able to prevent the push to remote, but the commits from the merge command is still staged locally, thus having to reset HEAD~n. I am looking for a cleaner way to prevent
git merge x
git merge x
if I am invoking that command from
branch y
branch y
and only
branch y
branch y
, to be staged locally. Can the client side pre-commit hook somehow check for this? Any suggestions?
11 replies