Can't add Git repository to Xcode 7 using https - xcode

After my upgrade to Xcode 7 the access to my Gitlab repo was denied. I am using HTTPS authentication. When I try to erase and than add a new the repo Xcode gives me an error : Authentication failed because the user name or password was incorrect.
The authentication field is set to Username and Password.
In that question a solution was given but for the SSH authentication:
Cannot push to gitlab from xcode 7
I prefer to use the HTTP method.
I think this is definitely an issue caused by the upgrade. Has someone else encountered that problem and can You share Your solution.

Recently I thought of that issue and tried to add a repository. Since the last time I checked the behaviour I have updated the Xcode to version 7.2. With a great relief I found that the problem has been fixed. However when I tried to commit / push to my repo I encountered an error "Couldn't communicate with a helper application" in Xcode 7". After some digging I found the answer here http://pinkstone.co.uk/how-to-fix-couldnt-communicate-with-a-helper-application-in-xcode-7/
I just followed the instructions and typed :
xcrun git config --global user.email you#yourdomain.com
xcrun git config --global user.name "Your Name Here"
in the terminal and the problem was fixed.

Related

Xcode Authentication failed because no credentials were provided after changing iOS version to 14

I changed my app deployment version from iOS 13 to iOS 14 and I am getting an error building the app.
It keeps talking about no credentials provided although all these packages are public. Also I have github credentials set up and use them all the time.
I have tried removing github account, changing ssh -> http, but nothing seems to help.
Same issue happens when I try to add a new public package using Swift Package Manager
Any suggestions?
I had a similar issue, the error I was receiving was:
xcodebuild: error: Could not resolve package dependencies:
Authentication failed because the credentials were missing.
artifact not found for target 'AddonManager'.
The solution was to generate my SSH key using RSA instead of Ed25519, it seems like Xcode couldn't read my SSH key in the Ed25519 format.
I re-generated my SSH using the legacy RSA algorithm (as noted in the github docs) and added it to my local machine, this fixed the error on the next build.
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Check your git config file first write your terminal: git config --global --edit
and it is supposed to be there "https://github.com/: rather than url.git#github.com.

XCode 9.1 cannot clone git bitbucket repo: authorization failed

Today I updated my XCode to 9.1 and now I can no longer clone bitbucket repos into XCode.
When I try I get "Authorization failed".
I don't know if it related but also today, when I logged into bitbucket I got a message saying I could not longer log in using my username but had ot use my email address.
Previously I would use this link when cloning a repo into XCode:
https://totsubo#bitbucket.org/totsubo/wordscardsnew.git
XCode then automatically sets my username to 'totsubo', and I cannot change it. I enter my password in the password field but after clicking 'done' XCode gives me an 'Authentication failed' error.
Strangely enough if I put the password into the https link, then XCode is able to clone the repo. (https://totsubo:password#bitbucket.org/totsubo/wordscardsnew.git)
I emailed Atlassian and they suggested re-setting my password. This fixed the issue.

Git - The Remote Repository Rejected Commits

I created a new branch manually from Xcode, which for some reason did not show up on the repository, so I made another branch from the GitHub browser manually. Then when trying to commit I'm met with the error:
"The remote repository rejected commit. Make sure you have permission to push to the remote repository and try again."
I've talked to my boss who ensured that I'm given written permission, so we're both confused as to why I can't commit properly.
If you have this option selected in the Email Settings page of GitHub it will prevent you from pushing.
You need to go in to terminal, and then go to your project directory and type these commands.
xcrun git config user.name "your username here"
xcrun git config user.email youremail#somedomain.com
Make sure the user name and emails are the exact ones that you use on github, gitlab etc.
I was using "Personal Access Token" for authentication and was facing the same issue. For some reason, generating a new token and entering it again in Xcode -> Preferences -> Accounts fixed it.

Xcode Repositry Git Error

Please review the screen shot, and let me know how can i fix this? I am using my computer and this configuration from last 1 year and I have no issue, It is suddenly happen.
You seem to try to commit/push to a remote repository, while you haven't yet given git your identity/email address + password.
The steps to do this are already stated in the error message:
Just open up Terminal and enter the two commands:
git config --global user.email "youremail#example.com"
git config --global user.name "Your Name"
You'll be prompted for your password several times. To cache your password follow the instructions here: https://help.github.com/articles/caching-your-github-password-in-git/

Git pushes files to github with wrong username

I'm trying to push my committed changes to Github using Terminal on Mac OS but
it keeps saying that the access to the repository is denied to my old github user
Permission to myuser/test1.git denied to "OldUser".
fatal: unable to access 'https://github.com/"NewUser"/test1.git/': The requested URL returned error: 403
I found some similar problems but none of the answers worked for me:
First of all Iv'e removed all the SSH keys from my mac and created a new one which I then synced with my github account.
Second, I have set the Global config for git to my new username and email using
git config --global user.name AND user.email
When I changed the user and email in the git local config file in my project dir (thinking at least that would work), I was surprised to see the same error when pushing, with my old user name popping out again.. (I really thought a local config would override any old global values) I just don't know where to look anymore..
There are no git environment variables defined and the SSH keys were all re-created.
seems that the last option is to re-install git which would be a really ugly way out..
Oh! BTW when i'm trying to push to github using the dedicated MacOS app it works just fine! I wasn't surprised a bit because all users reporting this problem said that the app worked for them just fine.. Just thought I mention it!
So, if anyone got an answer (or at least a hunch) it would help me a lot.
BTW when I'm trying to push to github using the dedicated MacOS app it works just fine!
It is possible the gitHub for Mac is using https url, with your GitHub login/password (which GitHub for Mac is caching).
Check the url associated with your remote origin:
git remote -v
If it is an https url (like your error message suggests "unable to access 'https://github.com/"NewUser"/test1.git/'"), no amount of SSH fiddling will change that error.
Maybe, for http url, the Credential Caching on Mac OS X has still the old credentials.
I had the exact same error on Windows and apparently it's a Git problem. Thanks to ayan4m1 at github forums (https://github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/152) I finally fixed this issue in Windows using notepad in admin mode to delete the credential.helper = manager lines from the C:\Program Files\Git\mingw64\etc.gitconfig file. Nothing else worked.
Apparently since I was in non-elevated mode in Git bash from my IDE none of my global commands were able to overwrite the global file. Hope this helps and saves time for someone else with this issue.

Resources