I am having troubles when I connect with my repository through Xcode.
I have a Gitlab version (full pre-)installed on TurnkeyLinux Virtual Appliance on a remote server.
Here using Xcode 7.3.1 and finally managed to push using ssh (and Gogs as github server) by doing so:
1) select the correct private key (there must also be the public key file present)
on Gogs side:
2) add that same key from the Gogs user Settings->SSH Keys
3) under admin panel: Dashboard: Operations: rewrite the authorised_keys file
Done