2014-02-08 62 views
2

我做的第一件事是从XCode->Preferences->Accounts添加一个远程存储库,其中包含正确的地址,用户名和密码。使用我的用户名无法从Xcode 5推送Git

之后,我去Source Control->Push,它总是问我为git用户,而不是我的用户,密码为什么?

enter image description here

+0

你用什么混帐协议:

存储库下>帐户执行源代码控制操作时无法连接使用ssh别名要么,但奇怪的是它们的功能就好了? – trojanfoe

+0

@trojanfoe:我正在使用ssh – Kobe

+0

通过再次创建我的远程回购来修复它。 – Kobe

回答

1

我已经找到了回购的GitHub上和到位桶最好的解决方案是创建一个SSH密钥对,没有密码。

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

然后添加以下内容:

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

并且接着指回购为:

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

这非常适用在Xcode,但是我看到的 “绿色灯” 旁在拉回回购期间,但(这可能是Xcode 5.1测试版中的一个错误)期间回购旁边的“红灯”,但它的工作原理没有抱怨,并且不需要密码,如果您使用Jenkins来完成您的发布版本,这非常棒。

enter image description here

+0

你可以发布你的[这个问题]答案(http://stackoverflow.com/questions/21657022/update-tableview-if-data-is-changed-online)。现在我明白你在说什么了,但是需要你的回答......还有示例链接,这样的例子发布会很棒...... –