I need to restrict the developers from changing the repository.
Can i restrict the git remote set-url command ?
Hi Alaa and welcome to the community!
I don't think there is a way to restrict this. What this command does is change the remote url that is present in the file .git/config inside a clone of a repo. If a user clones a repository on their computer, they will have permissions to change this file as well.
You could use a client-side pre-push hook to check if the remote url has been updated before pushing:
These hooks though need to be stored in the .git/hooks directory inside each clone and they may also be deleted by a user.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.