git clone is throwing repository not found error - github

While trying to clone my private repository, I'm getting the following error
fatal: repository 'https://github.com/kefitech/qp-guard.git/' not found
I have done some googling but unable to solve the issue.
Steps completed
1. config --global user.name and password is set using terminal (windows cmd)
2. git remote -v
git remote -v is returning an error:
fatal: not a git repository (or any of the parent directories): .git
So, tried set the remote URL to my repository using the command:
git remote set-url origin https://<my-user>#github.com/<my-org>/qp-guard.git
Bur this also returning the same error returned by git remote -v command
Please note that:
1. I'm a collaborator
2. I can clone any public repos
3. I have not used git client (terminal, cmd) for a long time but it was working before.
Looking forward to any pointers to solve this issue.

Related

Existing remote github repo not found via command line push

OS: Mac Mojave
I have a personal GitHub account that I contribute to, and some other corporate accounts that I contribute to as well.
On my private account, I created a private repo, and what I would like to do, is check some source code, that I have on my local disk, into that repository.
From a Mac terminal, I made sure I was in the directory I wanted to check into the empty private repo, and then I did the following:
git init
git add .
git commit -m "checking existing files into my private repo"
I then went to my private repo, and copied the URL, let's say:
https://github.com/myaccount/myPrivateRepo
I then did the following:
git remote add origin https://github.com/myaccount/myPrivateRepo
and then did:
git remote -v
And got the following response:
origin https://github.com/myaccount/myPrivateRepo (fetch)
origin https://github.com/myaccount/myPrivateRepo (push)
Which I assumed means: everything checks out OK
Then I tried to push, using:
git push -u origin master
Which gave me the following error message:
remote: Repository not found.
fatal: repository 'https://github.com/myaccount/myPrivateRepo/' not found
Any ideas?
I trued changing the remote to:
git remote add origin git#github.com:myaccount/myPrivateRepo.git
and when I tried to push, I got the following error:
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) 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.
The remote you add should be of this form:
git#github.com:myaccount/myPrivateRepo.git
Also set your git email address to match those of your github account:
git config user.email "you#example.com"
git config user.name "Full Name"
You can also edit these by editing the .git/config file.
Finally, make sure your SSH public key is correctly set up:
https://github.com/settings/keys
Your public key should be located in cat ~/.ssh/id_rsa.pub. You can print it with:
cat ~/.ssh/id_rsa.pub
If you don't have an SSH public key yet, then follow this guide:
https://help.github.com/en/articles/connecting-to-github-with-ssh

can't able to perform git push, permission denied?

I already made a repository in github as wordpress-template.
I created a .git repository locally, added some files there, and committed it.
Then I created a remote as origin and give it the url of the github repository as:
git remote add origin git#github.com:squalporeover/wordpress-template.git
Now I want to push my master branch to that repository. I ran the following command:
git push origin master
But it shows:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It looks like you added the SSH version of the remote URL. In order to use this you need to set-up Github with SSH.
Otherwise use the HTTPS version of the clone URL which will ask for your username and password:
You need to use ssh-keygen to generate an ssh key pair.
See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Duplicate found here: Git - Permission denied (publickey)
This worked for me:
Step 1- git remote rm origin
Step 2-select the http option in github
step 3- run the following command again
git remote add origin https://github.com/yourdirectory/link.git
git branch -M main
git push -u origin main

Github- repository is on remote but not found when pushing

I'm trying to push something to github and I'm getting this error;
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git push -u origin master
fatal: repository 'https://github.com/BitMechanic/Stanford-CS106b/Huffman.git/' not found
Then when I check I get this;
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote add origin https://github.com/BitMechanic/Stanford-CS106b/Huffman
fatal: remote origin already exists.
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote -v
origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
(fetch)
origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
(push)
Anyone know what I'm doing wrong?
The proper url to use (for cloning and then pushing through origin) is
https://github.com/BitMechanic/Stanford-CS106b.git
not:
https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
Stanford-CS106b is a repo, listed in the BitMechanic's repo page of d. Stanford-CS106b/Huffman is not.
To fix this, see git remote commands:
git remote rm origin
git remote add origin https://github.com/BitMechanic/Stanford-CS106b.git
or, simpler:
git remote set-url origin https://github.com/BitMechanic/Stanford-CS106b.git
Can you paste the
$cat .git/config
output here for reference.
Sometimes it is better to remove the remotes that are misbehaving from there and re-add it using the git remote add command again.

GitHub pushing/pulling error

I'm kinda new to GitHub, and I just created my account and set it up, etc. I followed the steps very carefully on http://help.github.com/create-a-repo/ but then when I do the very last command ($ git push -u origin master) it says:
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I have made the Repository, and it matches the name, but I still can't seem to get it to work. Any suggestions?
git will try to contact the remote repo you just declared in the previous line of the GitHub tutorial:
git remote add origin git#github.com:username/Hello-World.git
git push -u origin master
As illustrated in:
"Why are Github project document page urls case sensitive? What are the negative effects?", and
"github http clone returns 'did you run git update-server-info on the server'",
your error message is likely the result of a:
case mistake (git remote add origin git#github.com:username/**h**ello-**w**orld.git)
or url error (git remote add origin git#github.com:username/HelloWorld.git, forgot the '-').
The OP user1302394 confirms, in the comments:
git remote -v gives me:
origin git#github.com:username/Helloworld.git (fetch)
origin git#github.com:username/Helloworld.git (push)
Which means he/she combined a double whammy:
case mistake (world instead of World)
and url mistake (Helloworld insteadd of Hello-World)

The remote end hung up unexpectedly

I installed Git and ran the set up my username and email.
git config --global user.name "Your Name"
git config --global user.email username#gmail.com
Add your public key
Next, I created a project directory called 'projectname' and committed this to a remote Git server.
mkdir projectname
cd projectname
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git#github.com:projectname/projectname.git
git push origin master
My public key has been added to the github website.
When I try to commit I get this error message:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Any suggestions? - I am working with Ruby on Rails
Make sure you copy past the SSH key exactly like it's in the xxxx.pub file do not add lines or spaces to it.
Try again or delete both public and private keys and generate them again. It should work. Also remember to update the pub key again on Github website.
Also test your existing key with this command
ssh -T git#github.com