Search code examples
gitgithubsshbitbucketssh-keys

Safe to change remote repo url from https to ssh?


I want to take a git pull from by shell script, and for that sake I refered to this answer here.

Automating Git pull process on a ec2 ubuntu instances

In this process, I am required to add my ssh key in my github/bitbucket profile and then change the remote repo url from https to ssh, so that I can leverage ssh for taking an git pull. This is supposed to help me taking a git pull from a shell script, and not be prompted for a username/password.

My hiccup here is that, I cannot seem to figure out that after changing the remote url from https to ssh, what will be the implications for other developers on my team, who have not submitted their ssh keys in their profiles.

Will they still be asked username:password, just like old days, or would they have to add their individual ssh keys to their bitbucket profiles?

Any help will be extremely appreciated, thanks!


Solution

  • HTTPS and SSH are just the different protocols to clone/pull/push etc. git repositories. If you change your way of accessing repository from HTTPS to SSH for your user, it won't affect others. They will not even know that you have changed your protocol. Other users will keep getting same Username:password prompt as they are getting currently. Whoever wants to use SSH, need to add their SSH keys same as you did.