Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Restrict git remote set-url

Alaa Dika
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 6, 2024

I need to restrict the developers from changing the repository.

Can i restrict the git remote set-url command ? 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2024

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events