7

I encountered a problem when I wanted to push my project to GitHub via Xcode.

Attention, I am not talking about terminal here. I have to set the Xcode environment for the artist in my team. Terminal is not working for him...

I tried to use the HTTPS address (https://github.com/zeroliu/DumplingJump.git) at the beginning but always receives a 403 authentification error.

error: The requested URL returned error: 403 while accessing https://github.com/zeroliu/DumplingJump.git/info/refs fatal: HTTP request failed

By searching everywhere, I found that GitHub actually only accept SSH way. But weirdly, I can use HTTPS way to push my project via Terminal...I don't think that statement is right.

Anyway, then I tried the SSH way but it is also not working. Xcode asked me to type in my username and password but no matter how many times I tried, it was just not working. I think the problem comes from Xcode itself, since the SSH address is in form of git@github.com:Organization/Repository.git, Xcode stupidly considers the user name is git, but not Organization...and as I change the user name when pushing the project, Xcode will automatically replace "git" by my username, which changes the address to Organization@github.com:Organization/Repository.git. That should be the reason why I can not get the access via SSH.

Does anyone of you succeed in pushing the project to GitHub via Xcode? Really need your help!! Mega Thanks!!!

zeroliu
  • 990
  • 2
  • 10
  • 15

1 Answers1

19

I always set the github URL to:

https://username:password@github.com/username/Whatever.git

Which is bad for security, but I've wasted enough time trying to get SSH to work with multiple key pairs and I cannot be bothered to type my username/password every time.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242