Gitlab premission denied - macos

Hello i have a gitlab server and the web interface works just as ssh -T git#mijnstageportaal.nl,
but when i try to upload a folder to a blaco project its says this
git init
git remote add origin http://mijnstageportaal.nl/marijnboeve/sinterklaas-intocht
git add .
git commit -m "Initial commit"
git push -u origin master
Reinitialized existing Git repository in
/Users/marijnboeve/websites/sinterklaasintocht/.git/
fatal: remote origin already exists.
HEAD detached from v8.0.1
nothing to commit, working tree clean
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.

Look at
Please make sure you have the correct access rights
and the repository exists.
Most probably, you don't have a public key id_rsa at path /Users/YOUR_USER_NAME/.ssh.
You should generate it, e.g. ssh-keygen -t rsa -b 2048 -C "email#example.com" (see https://docs.gitlab.com/ee/ssh/).
Or, repository at http://mijnstageportaal.nl/marijnboeve/sinterklaas-intocht really doesn't exist. You can check it with your Web client, if possible, or ask a repository owner.

Related

git commands fail to authorize after ssh authorization succeed to connect to git#github.com

I have created a private git repo on github.
I ran the commands ssh-keygen -t ed25519 -C "me#gmail.com" -f ".\id_ed22519_me" and ssh-add .\id_ed22519_me to create the private and public keys, and added the public ssh key to github.
I also have setup the following config to use the correct keys:
#~/.ssh/config
Host github.com-me
HostName github.com
User git
IdentityFile ~/.ssh/id_ed22519_me
IdentitiesOnly yes
However when I try to use the git command I get the following error:
#powershell
PS C:\Path\to\Project> ssh -T git#github.com
Hi me! You've successfully authenticated, but GitHub does not provide shell access.
PS C:\Path\to\Project> git push --set-upstream origin master
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.
Can anyone know what could lead to that? I also have made sure that I use the correct url for the remote "origin", and that my branch is indeed "master"
https://gist.github.com/jexchan/2351996#gistcomment-522294
This appears to resolve my issue.
I'm a bit weirded out that I have to append my username to the URL, but it works ^^

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.

Gitolite, can't clone new repo

I've just installed gitolite on my Debian server.
Then I cloned gitolite-admin repo and and new public key + following lines to conf file:
repo wallr_common
RW+ = wall
New repo was created after push.
At first I go to authorized_keys and saw that key for new user not exists, then I run ~/.gitolite/keydir$ gl-setup, and the key appears in authorized_keys.
Now I'm trying to clone it but I'm getting error:
git.exe clone --progress -v "ssh://wall#192.168.1.110:/wallr_common.git" "D:\wallr_common"
Cloning into 'D:\wallr_common'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
git did not exit cleanly (exit code 128) (5834 ms # 04.07.2013 0:27:46)
What can be the root cause of this?
You must use the git or gitolite account for your ssh session. Not the user account wall that you registered in gitolite.
That means ssh://git#..., instead of ssh://wall#....
Replace 'git' with the account you used to install gitolite.
See more at "How do programs like gitolite work?".
This is a similar mistake as in this question.

Unable to Change my Remote Repo

I am a bit new to git, and as a result I have gotten myself into a git mess. I have an Xcode 4.5 project. In the command line I have been managing its local git repo as well as a remote repo on github that the local one is linked to. All was well until I decided to delete the remote repo on the GitHub website (called PictureFly) and create a new remote repo on the GitHub website (called PhotoFly). I would like my local repo to be unlinked to the old remote repo (PictureFly) and linked to the new remote repo (PhotoFly). Seems simple, but no matter what command I enter, I get one fatal warning or another. Here is a typical example of what I have been doing:
My attempts to remove the old remote origin:
//first attempt
git push origin :https://github.com/jac300/PictureFly.git
//first error
fatal: remote part of refspec is not a valid name in
:https://github.com/jac300/PictureFly.git
//second attempt
git push origin :PictureFly.git
//second set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
//third attempt
git push origin --delete PictureFly
//third set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
//fourth attempt
git push origin --delete https://github.com/jac300/PictureFly.git
//fourth set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Then I thought maybe I can just add the new remote repo:
git remote add origin https://github.com/jac300/PhotoFly.git
fatal: remote origin already exists. //how does it already exist?
So since it "already exists" I tried to push to that repo:
git push -u origin master
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
I have no idea what is happening or how to fix it. Any help is appreciated.
You can easily remove the repo on GitHub and create a new empty one from the website. So now you're stuck with your remotes pointing to the wrong url. To fix:
git remote set-url origin https://new.url.here

MSysGit Not finding Repo

So I had a repo working by adding it to the htdocs in apache, however, I couldn't commit. So I set up SSH (I am using copSSH) and I can ssh into the server and see the files in my project.git. However I get the following when I try to clone...
$ git clone un#server:/home/un/Repositories/git/test.git/
Cloning into 'test'...
un#server's password:
fatal: '/home/un/Repositories/git/test.git/' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Any ideas?
Oops this did work...
git clone un#server:Repositories/git/test.git/
Must be an environment var issue

Resources