0

When using Swift Package Manager(SPM) in Xcode, I noticed that cloning a private project with a GitHub token would result in an error.

Showing All Messages:

Error while fetching remote repository: OUR PRIVATE PROJECT
x-swift-package-repository-authentication: OUR PRIVATE PROJECT Authentication failed because no credentials were provided.

So I rewrote the configuration file with reference to the following.

fatal: could not read Username for 'https://github.com': No such file or directory

Then, this time, the open source GitHub project gives me an error.

I'm trying to reproduce it by clearing the Xcode cache many times, but sometimes it succeeds without error, so maybe I need to change the If condition, but anyway, I want to use IF statements in different ways depending on the project.

looks like this:

if OUR PRIVATE PROJECT
  [url "git@github.com:"]
    insteadOf = https://github.com/

I looked at the following, but the grammar was unfamiliar to me and I couldn't write it well.

How to auto switch email address by url in Git?

Note: In some cases, there are variations in the errors, and sometimes I'm asked to enter the token multiple times.

I'm having trouble with instability, getting errors and successes even with the same settings. I'd like to see what's going on with the IF statement to determine the cause.

I've cleared the cache(Reset Package Caches, Clean Build Folder) and restarted many times, and each time the Xcode error is slightly different.

shingo.nakanishi
  • 1,443
  • 16
  • 47

0 Answers0