Cannot push to gitlab from xcode 7

前端 未结 5 1546
攒了一身酷
攒了一身酷 2021-01-05 02:59

One unhappy side effect of upgrading to Xcode 7 is that I can no longer push to my Gitlab repo. I have been pushing and pulling from my project without problem for the last

相关标签:
5条回答
  • 2021-01-05 03:10

    So this one was quite a bear to wrestle, and to be honest, I am not sure what the root cause of this error was, but the way I resolved it was this:

    1. Removed my old ssh key from GitLab
    2. Created a new ssh key on the command line, then added it to GitLab
    3. Removed the GitLab repo from Xcode > Preferences > Accounts
    4. Re-added the GitLab account, using the SSH Keys Option (which it was before as well, this is not new)
    5. Closed Xcode
    6. Blew away the working directory of the project
    7. Opened Xcode, then chose Source Control > Checkout
    8. Provided the SSH address (which you can get from GitLab within your project folder)
    9. Made a minor change to the project for the purposes of testing the ability to Push
    10. Pushed to GitLab via Xcode Source Control > Push

    Voila! Worked. This was definitely the nuclear option but it got me working again. I firmly believe that upgrading Xcode to 7 screwed something up. If anyone else has this problem I hope this resolves it!

    0 讨论(0)
  • 2021-01-05 03:21

    My issue was that id_rsa was a symbolic link.

    My .ssh/id_rsa file was a symbolic link to another file. In xcode, I had specified this symbolic link as my ssh private key file.

    In this configuration, git pull was working but git push was failing.

    Then, in xcode, I changed the ssh private key file to point to a regular file (the file that the symbolic link was pointing to). And voila, both push and pull are working now.

    Xcode Version 8.1 (8B62)

    0 讨论(0)
  • 2021-01-05 03:28

    Same issue with xcode 7.

    I managed to fix this issue by regenerating the RSA keys and updating them in Gitlab.

    Edit: unfortunately this worked only 1 time

    Edit2: After working one time "right out of the box" after changing the SSH keys, the second time I got the question for login credentials, the dialog where you can choose between username/password and SSH keys. Choosing SSH key then worked. After that the dialog didn't appear anymore.

    So, to summarise:

    1. XCode push to Gitlab not working (asking for login credentials, SSH key not working)
    2. Regenerated SSH RSA key and added it to Gitlab (I removed the old one)
    3. Then pushing worked without dialog
    4. Next time xcode asked to login by either username/password of SSH keys
    5. Selecting SSH keys worked
    6. After that the login dialog didn't appear anymore
    0 讨论(0)
  • 2021-01-05 03:31

    My problem was that Xcode tried using the wrong key file : .ssh/id_rsa instead of .ssh/id_dsa

    0 讨论(0)
  • 2021-01-05 03:34

    I found that Xcode 7 does not like tilt "~" in the URL anymore. Please run "git config --list" and check the URLs. For example, my remote URL looked like this:

    ssh://nobody@nowhere.com/~/product1.git
    

    Xcode can push fine after I run the following commands:

    git remote set-url origin ssh://nobody@nowhere.com/home/nobody/product1.git
    
    git config branch.master.remote ssh://nobody@nowhere.com/home/nobody/product1.git
    
    0 讨论(0)
提交回复
热议问题