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 if I am invoking that command from and only , to be staged locally. Can the client side pre-commit hook somehow check for this?
Any suggestions?
8 Replies
⌛
This post has been reserved for your question.
Hey @nicolaiklokmose! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
use a pre-commit hook?
though that couldn't block fast-forward merges
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
@dan1st pre-commit does not work properly either, more multiple reason 1) as you stated ff, and 2) it will stage the changes. I want to ideally block it at an earlier step in the invocation of git merge.
the next best option is post-merge at which you could inform the user that they merged even though they shouldn't - but you wouldn't have information on what was merged in what way and can't abort it
yes. Which is also not ideal.
another option might be to overwrite the
git merge
command directly💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.