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 [email protected]: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 [email protected]: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!!!
Push your project to GitHubGo to Source Control > Push. You will have to enter your GitHub user name and password the first time. That's it. Now any time you make changes in Xcode, all you have to do is Commit and Push.
Push your projectGo to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.
Ones you're in the Xcode, press “command + , ”. Now you should see the Preference window. Navigate to “Accounts”, and lets login to our Github account from Xcode by pressing the “+” icon on the bottom left corner. After selecting Github and pressing confirm, you will be able to add your Github user name and password.
I always set the github URL to:
https://username:[email protected]/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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With