# Git: force to use SSH URL instead of HTTPS for github.com

**URL:** <https://discuss.bitrise.io/t/git-force-to-use-ssh-url-instead-of-https-for-github-com/4384>\
**Category:** How To\
**Created:** [March 6, 2018, 12:41pm UTC](https://discuss.bitrise.io/t/git-force-to-use-ssh-url-instead-of-https-for-github-com/4384 "2018-03-06T12:41:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 6, 2018, 12:41pm UTC](https://discuss.bitrise.io/t/git-force-to-use-ssh-url-instead-of-https-for-github-com/4384/1 "2018-03-06T12:41:31Z")

</div>

You can instruct `git` to use the SSH git clone url (`git@...`) instead of HTTPS one (`https://`) in every case.

Regardless of whether e.g. your CocoaPods spec includes the SSH or HTTPS [github.com](http://github.com) git clone url git will always use the SSH one (`git@`) this way. This can be useful if you use private submodules or CocoaPods spec/repos or any other tool which uses git and you want to force them to use SSH git clone URLs instead of HTTPS ones, as explained at: [http://devcenter.bitrise.io/faq/adding-projects-with-submodules/](http://devcenter.bitrise.io/faq/adding-projects-with-submodules/)

To reconfigure `git` to use SSH git clone URLs for github instead of HTTPS ones just run (e.g. using a Script step):

```auto
git config --global url."git@github.com:".insteadOf "https://github.com/"

```

This instructs git that in every case when the git clone URL starts with `https://github.com/` it should replace it with `git@github.com:` before contacting the server.

_Note: this affects **every** git operation after running this `git config`, for [github.com](http://github.com) repos! It will always convert the URL and will use the SSH url instead for [github.com](http://github.com) repos._

---

<div class="post-metadata">

**Author:** ![Atcom](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/atcom/32/3499_2.png) [@Atcom](https://discuss.bitrise.io/u/Atcom)\
**Post date:** [April 27, 2021, 7:06am UTC](https://discuss.bitrise.io/t/git-force-to-use-ssh-url-instead-of-https-for-github-com/4384/2 "2021-04-27T07:06:29Z")

</div>

Hello,

My private repo is hosted on [bitbucket.org](http://bitbucket.org) and I tried your suggestion but with [bitbucket.org](http://bitbucket.org) and it didn’t work 😕

Any suggestions @viktorbenei ?

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [May 18, 2021, 11:04am UTC](https://discuss.bitrise.io/t/git-force-to-use-ssh-url-instead-of-https-for-github-com/4384/3 "2021-05-18T11:04:43Z")

</div>

Hello there,

Can you please send us the log file or the URL of the related build and also enable Support Access on the `Settings` tab of the app ( [Enabling the Bitrise Support user for your app | Bitrise DevCenter](https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/) ) so that we can take a more in-depth look? 🙂
