On doing composer install getting error for private repo - composer-php

When trying to clone my private repos ;
[RuntimeException]
Failed to clone git#github.com:myOrganization/myRepo.git via git, https, ssh protocols, aborting.
git://github.com/myOrganization/myRepo.git
Cloning into '/Users/yus/Desktop/websites/h-s/vendor/xx/cache-bundle/xx/CacheBundle'...
fatal: remote error:
Repository not found.
https://github.com/myOrganization/myRepo.git
Cloning into '/Users/yus/Desktop/websites/h-svendor/xx/cache-bundle/xx/CacheBundle'...
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/myOrganization/myRepo.git'
git#github.com:.myOrganization/myRepo.git
Cloning into '/Users/yus/Desktop/websites/h-s/vendor/xx/cache-bundle/xx/CacheBundle'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Does a manual git clone git#github.com:myOrganization/myRepo.git work for you?
As far as I can tell, you have not setup an oauth token, and the ssh key it is attempting to use is not valid for the repository you are trying to access. So there is no way for Composer to access your private repository.

Related

Permission denied (publickey) error when trying to clone from GitHub

I want to clone a repository and I ran into permission issues,
I tried to set up my username and email but keep getting errors
I used
git config --global user.name "yusuf-uthman"
git config --global user.email "yusufuthman57#gmail.com"
but didnt get any notification wether its accepted or not.
Uthman#DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git config --global user.name "Uthman Yusuf"
Uthman#DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git config --global user.email "yusufuthman57#gmail.com"
Uthman#DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git clone git#github.com:yusuf-uthman/hng-internship.git
Cloning into 'hng-internship'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How do I clone the repository without getting the error?
The failure comes from cloning your GitHub repo via SSH URLs. To use that process, one needs to add your public SSH key in your repository.
Instead use HTTP URL method to clone which will most likely circumvent that error.
Use:
HTTP URLs: https://github.com/yusuf-uthman/hng-internship.git
instead of:
SSH URLs: git clone git#github.com:yusuf-uthman/hng-internship.git
but didnt get any notification wether its accepted or not.
Username and Email are just settings in you git config file, no one will accept or decline it. If you commit, the value of the settings will be used to determine the commits author and committer.
Access rights to a repository are usually managed via ssh keys. See Connecting to GitHub with SSH.

composer install does not use ssh key on private repo (permission denied public key)

I have a Laravel project with some dependencies to private packages, secured through ssh, working on windows 10 with Laragon.
On composer install I get a permission denied (public key), however, if I clone the repo directly I get my regular prompt to type the ssh-key password for authentication and the clone works with no problems (using git#gitlab...., so no https).
The output looks like this:
Failed to execute git clone ...
Cloning into 'project/path/foo/bar'...
Permission denied (public key).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I already added the host (a private GitLab server) to my git config file, including the path to my ssh key, which seems to work due to git clone succeeding.
I expected that composer install would prompt for the password, but it just stops.
Any ideas how to solve this problem? I normally work on Ubuntu and didn't have such a problem before.
Edit:
Tried out the same commands with git bash (Git for windows) and it worked. But if I use Powershell or ConEmu(through Laragon) it won't work, any ideas?

Copying a repository with tortoise hg : Access denied 255

I am trying to clone a repo with TortoiseHg Version 2.4.2 including Mercurial-2.2.3, Python-2.7.3, PyQt-4.9.1, Qt-4.8.0.
This is the Hg command: hg clone --verbose --directory adress -- my repo
It´s the same command other users are using but I always get a
remote: abort: Permission denied: .../.hg/store/00changelog.i
abort: unexpected response: empty string
command returned code 255;
Could it be possible that there is something with an IP range for the access of the files? Or the user access?
The reason it didn´t work was that my account was not set up as trusted user.
Adding the account to the trusted user and group and then it worked smooth.

Git repository cloning with GitPython - repository not found Authentication Failed

I am trying to clone private repository using Python. I am using Git Python package to clone the repository but I am getting an error:
Error :
GitCommandError: 'git clone -v https://github.mit.edu/mitx/content-mit-1690rgit edxcourse' returned exit status 128: Cloning into 'edxcourse'...
remote Repository not found.
fatal : Authentication failed for 'https://github.mit.edu/mitx/content-mit-1690.r.git/'
However I am a member of this repository and I have access to the repository.
In your case, gitpython merely returns an error it received from the git executable it envoked.
If you call git clone -v https://github.mit.edu/mitx/content-mit-1690rgit on the commandline, you will receive a similar error, indicating something might be wrong with your URL. Possibly it is the rgit extension, which might be a typo.
Maybe one of the devs can confirm this as I have only been playing around with Git-Python for the last few hours.
When cloning over http(s) it seems to rely on the .netrc file rather than asking for auth like the Git CLI client would.
cat > ${HOME}/.netrc < EOF
machine github.mit.edu
login <username>
password <password>
EOF
chmod 600 ${HOME}/.netrc
If you're on Windows, that works via Cygwin too.
The repository which I was trying to Clone is a secured repo. So I need to establish a secure ssh authentication connection. and then it worked for me.

SCM-Manager with Xcode

I have installed SCM-Manager. I would like to use it in the future for version control. The problem is, I cannot add it as a repository in Xcode, and I cannot clone it from command line:
$ git clone http://127.0.0.1:8080/scm/git/MyRepo
Cloning into 'MyRepo'...
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
$
In Xcode I get this message:
fatal: unable to access 'http://127.0.0.1:8080/scm/git/MyRepo/': The requested URL returned error: 403
SCM server logs this
failed to read basic auth credentials
I have tried to install on different server, checkout with different user, nothing helped.
The first message means that you have cloned an empty repository. The message is only a warning and the repository is fully functional. A better way is to create the "bare" repository in SCM-Manager and add the remote reference to a local created repository:
git init MyRepo
git-remote add origin http://127.0.0.1:8080/scm/git/MyRepo/
The messages from Xcode sounds like missing credentials.

Resources