We recently made the switch to using a new software as a service build and deployment tool. During that switch we needed to change over our Git repositories to the new remote URLs. I am using Tower for Mac and couldn’t find a way to make the switch via the app. It simply doesn’t handle custom server authentication well.
Here is what I did to get things working again.
- Open Terminal or iTerm2 if you have it installed
- Navigate to the folder with your website files in it
- In my case it was my Sites folder and then picking the correct sub folder
- Once there you can run: git remote -v
- This will show you the current remote server URLs
- Next you can run: git remote set-url origin https://<URLOFGITHOSTEDREPO>.git
- This will set the current git working copy to use the new remote URL you specified
- Lastly run: git pull
- You will be asked for your username and password for the hosted git repository and once entered correctly your Tower app should now show the updated remote URL and work using your new credentials.
Once you have the credentials updated for one git repository in Tower they will be stored and work for the rest of your repositories.