2

First thing I did is add a remote repository from XCode->Preferences->Accounts with the correct address, user name and password.

After this I go to Source Control->Push and it always ask me for the password for the git user, not my user, why is that ?

enter image description here

Adrian
  • 19,440
  • 34
  • 112
  • 219

1 Answers1

1

I have found the best solution for repo's on github and bitbucket is to create an SSH key-pair with no password.

$ cd .ssh
$ ssh-keygen -t rsa -b 2048 -f github_id_rsa
$ vi config

Then add the following:

Host github
    HostName github.com
    User git
    IdentityFile ~/.ssh/github_id_rsa

And to then refer to the repo as:

ssh://github/trojanfoe/myrepo
      ^^^^^^
(note that's the name of the config "alias", not github.com)

This works well in Xcode, however I see "green lights" next to the repo during a pull, but "red lights" next to the repo during a push (this might be a bug in Xcode 5.1 beta), but it works without complaint and without the need for a password, which is great if you use Jenkins to do your release builds.

The Repositories under Preferences > Accounts cannot connect using the ssh alias either, but strangely they function just fine when performing Source Control operations:

enter image description here

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • can you post your answer for [this question](http://stackoverflow.com/questions/21657022/update-tableview-if-data-is-changed-online). Now I understand what you were saying but needs your answer back... also sample link where such example is posted would be great... – Fahim Parkar Feb 09 '14 at 14:05