Recently, I moved this website to A2 Hosting. Since I am using git at the office intensely for developing the company’s website, i felt like I’d have to continue using git for my home-story blog, too.
When I was a little more new to git, I chose Bitbucket as the service to host my repo. There I can have unlimited private repos with up to four more users and “sync” all changes on any device back and forth. So I wanted to set up git on my new hosting provider.
Getting command-line-acces and setting up SSH was very easy with A2’s cPanel. Since I – somehow – already managed to setup SSH via command line, this was a charm. But, connecting to BitBucket actually was not that easy. For security reasons, A2 Hosting is using another port für SSH-connections 7822 instead of the standard Port 22. So all efforts to establish a connection fail.
I asked the support team and they answered within 12 hours – despite (or because?) the time shift between Germany and the US. They actually did not provide a proper solution, but they gave me an essential hint.
To use a git repository from Bitbucket on A2-hosted machines, you have to use the following remote-URL-structure:
ssh://git@bitbucket.org:22/{username}/{repository}.git
You can do this either by using the command line
git remote add origin ssh://git@bitbucket.org:22/{username}/{repository}.git
or you could change the .git/config
-file in your repository’s folder and change the url-path in the [remote "origin"]
section via FTP or whatever.
Mark Ford says:
Thanks so much for posting this! It saved me a lot of time.
Regards,
Mark
robst says:
Thanks Mark, I appreciate your comment. Glad I could help :-)