Cannot connect to valid github repository - ruby-on-rails

I have read/write access to a private repository owned by someone else but RubyMine cannot connect to the Git URL. Workflow:
Open RubyMine
Click on "Check out from source control"
Select Git
Enter URL, click "Test", and Test fails
I'm using OSX Lion and my Github credentials have already been saved. I've tried connecting to a few other github URLs on the "Explore" tab at github.com and I haven't had any trouble. Suggestions?

I was able to fix this by following the tutorial on GitHub, Generating SSH Keys, exactly. I also deleted any existing keys in my account before adding a new one. In the RubyMine dialog, I pasted the ssh link to my repository instead of the HTTP one. Hope this helps someone else.
https://help.github.com/articles/generating-ssh-keys

I would recommend to create an issue in the RubyMine bugtracker and attach the log file there (Help -> Reveal Log in Finder). Maybe it is a bug in RubyMine support of Git over HTTP.
Meanwhile as a workaround you may use SSH, as adviced by user1836351.
Another workaround is specifying your credentials in the ~/.netrc file.
Example of the file content:
machine github.com
login yourname
password yourpassword

Related

Xcode 11 SPM authentication failed because no credentials provided

I started using Swift package manager and when I add repository with https (https://github.com/Alamofire/Alamofire.git) address authentication always fails when I try to login with my github account
Xcode authentication fail
But if I'm using git#github.com:Alamofire/Alamofire.git it will get added successfully. I tried regenerating new key, deleted .ssh directory but nothing makes https work and I still get xcode authentication failed because no credentials were provided error. I could use locally ssh url but in CI I need one with https.
It was a problem with git config. In .gitconfig file it was set to
[url "git#github.com:"]
insteadOf = https://github.com/
After removing this section https worked correctly
EDIT: as mentioned in comments you can easily access your gitconfig in terminal with command: git config --global --edit
In my case with Xcode 11.3.1 I had the same problem and I solved changing de auth method to SSH from HTTPS in Github account preferences on Xcode.
Building off of two previous answers, I solved this by doing what Abrahanfer did, setting Clone using to SSH in Xcode Preferences -> Account.
Then I used the SSH url of the repo, for example: git#github.com:AppPear/SwiftUI-PullToRefresh.git
you can use ssh URLs instead of https, e.g. git#github.com:ORG_NAME/REPO_NAME.git
I double clicked the error message Error while fetching remote repository: git#github.com:ORG/REPO-NAME.git or the The server SSH fingerprint failed to verify
in Xcode's Report Navigator which then a popup appeared asking if I wanted to trust the host. After clicking that I was able to add the Swift Package using SSH.
Selecting HTTPS or SSH in the Xcode Preferences did not fix for me because Xcode seems to automatically handle SSH GitHub URLs in the SPM flow.
what worked for me was both #SimonasDaniliauskas answer and #Abrahanfer answer
Basically in the command line I had to run:
git config --global --unset-all url.git#github.com:.insteadof
And in Xcode I had to go to Xcode > Preferences and switch my GitHub to use SSH
Btw, if you don't have ssh setup, follow this medium post or these GitHub directions. If you need change your ssh keys follow this YouTube tutorial
If you are facing this and your .gitconfig has below, and you want to keep it!
[url "git#github.com:"]
insteadOf = https://github.com/
just add below two lines after above two lines in your .gitconfig
[url "https://github.com/apple"]
insteadOf = https://github.com/apple
Duplicate above two lines and replace /apple with any other /user or /org where you might want to download your packages from
Try removing it and adding it again. If that won't work, remove your GitHub account from Xcode. Usually, git via ssh works better. What CI are you using?
For me, it seems more like a red herring (maybe a fellow developer accidentally checked in this small change related to swift package in project setting). I went to project setting, removed it from under "Swift Packages". It seems okay after that.
I keep having this issue in Xcode 12.0.1 (12A7300).
My GitHub credentials seemed to not work, even though I applied all the suggestions above.
The way I fixed it (for now, at least) was to switch to SSH only authentication.
I managed to get HTTPS working fine with CI. The solution, with bitrise, is to use 'Authenticate host with netrc', then Xcode will find private HTTPS repos properly. I am sure other CI platforms (or your own) can setup the same solution.
Adding repo via source tree and checking out repo through Xcode use some other tool, then adding same repo via SPM. Try creating SSH key via rsa key algorithm instead of ed255189 key algorithm. SPM tool comfortably work with rsa.
Note: rsa key authentication is slower than ed25519 key authentication.
I followed the other anwsers here with no success. Eventually it turned out that the package was added to XCode with my username inside the https domain, like that:
https://yarden_k#bitbucket.org/private/package/path.git
so I had to adjust the accepted answer the same way (I added those lines to .gitconfig file):
[url "git#bitbucket.org:"]
insteadOf = https://yarden_k#bitbucket.org/
And viola! It finally worked. Was a real headache to figure this one out.
Me too facing this problem
Check your repo access is correct and you have proper access for PUSH the code
They only gave me READ access, After facing this issue I'll informed to respective person and get WRITE access

SourceTree github repo not valid url

When I install SourceTree on my OSX, setup a Github account via ssh, and then copy/paste Github url/clone, It always says "Not a valid sourcepath/URL" even though the url is valid.
I have searched the web for the same issues, and found some interesting solutions, but non of them worked in my case. I have tried removing all of SourceTree's settings and completely uninstall the APP, but same stuff is happening. Also tried removing my account, removing ssh key etc. (I have git installed).
All of my connected repositories is shown under the tab remote, but I just can't clone anything.
The Github repo url is: https://github.com/myacc/teststuff.git
Any ideas what might be wrong? :/
First, if you are talking about ssh keys, the url to use should be an ssh one:
git#github.com:myacc/teststuff.git
Second, since I don't see that repo on your account, it could be a private repo.
Make sure yu have enabled Git on SourceTree (I prefer using the system Git, meaning a Git I have installed myself)

Xcode CI and cocoapods private repo

I've been trying to setup OSX server to use Xcode CI. My project uses cocoapods and a private repo. I've been following this tutorial: http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/
But when I login as the _xcsbuildd user and run the command to add the private repo I get the following error message
fatal: could not create work tree dir '<repo name>': permission denied
I don't have much experience with users and command line tools. I've seen many comments online saying people need to change permissions to get it to work. But I have no idea what I need to change and where.
Can anyone tell me where / what / how I need to modify to give this user access to complete this process.
Just found the answer. Had no idea where cocoapods was storing these repos. I opened finder. Cmd + shift + g
typed in ~/.cocoapods/repos
right click on the repos folder and give "everyone" read & write access to the folder. All good now, CI working completely

Rubymine thinks (incorrectly) that project is already on GitHub

Here is the setup: New project in RubyMine. Ran "Share Project on GitHub". It creates the repo. It attempts to send the project, but fails because my application firewall wanted confirmation of the new connection. I permitted it, but not before RubyMine got the error and cancelled.
Problem: Now I can not sync the project to GitHub from RubyMine. I've attempted to delete the repo from GitHub and re-run "Share Project on GitHub" but RubyMine always gives me the error "Project already exists on GitHub"...even when the repo is no longer there.
Is there a way to make RubyMine forget about this GitHub share and start fresh?
Go to your project physical location and find .git folder(hidden, right click open in new window, if you have problems on mac). You might need figure out how to show hidden folders/files on your OS.
Find file "config"
Delete section(s) [remote "name"]
Try to share again
Enjoy )

Remote Git repository unreachable in XCode 5

I have created a remote Git repository for a new project. I have added to my remotes and XCode recognizes it. When creating the new project, I checked the box for Source Control > create git repository on: and selected "Add to New Server"
When I enter my login credentials, I get the following message:
The server https://... is unavailable or may not exist. Check the server address, check your network connection, and then try again.
I have verified that my login is correct and the url is definitely valid. What might I be doing wrong?
Thanks!
Was able to solve my issue using the following:
git remote add origin git#github.com:pheepster/<repoName>.git
git push origin master:master
with the help of: https://stackoverflow.com/a/14470400/2115842
In addition to the two git commands in #Pheepster's answer, I suggest you check you are running the current version of GIT on both the development Mac and Server. Once I had the current version of GIT on both systems the two lines above solved my issue.

Resources