I have the repo here Link to the repo
I cloned it and did some changes but when I try to push it.
It gives me the following error:
$ git push origin HEAD:refs/for/master
Username for 'https://review.gerrithub.io': ardyflora
Password for 'https://ardyflora#review.gerrithub.io':
fatal: Authentication failed for
'https://review.gerrithub.io/ardyflora/virginPulseAuto/'
I have even added the ssh key. Any pointer or help will be appreciated :)
Authentication failure for HTTPS. Better you can take a try with SSH.
Copy the URL for SSH of your repository using a browser and update your local origin.
$ git remote set-url origin <ssh-clone-url>
$ git push origin HEAD:refs/for/master
Related
when I use
git remote -v
I receive
origin git#github.com:user/repo.git (fetch)
origin git#github.com:user/repo.git (push)
Which looks quite fine, but if I then try to
git push origin
I receive
\302\226\302\226git#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.
After I checked and reassigned the ssh keys for a thousand times I became suspicious about the address and tried
git push git#github.com:user/repo.git
And it worked like a charm. Any idea where I can fix that?
It looks like you've got some Unicode control characters (specifically two U+0096 characters) in your remote URL. You can fix this by doing this:
$ git remote set-url origin git#github.com:user/repo.git
That will set the remote URL to the right thing, and then you should be able to push and pull as normal.
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
I have my project on GitHub at some location,
https:github.com/vidurasilva/loging_Form.git
I used the commands one by one and there has errors also,
C:\wamp\www\PhpProject>git remote add origin https:github.com/vidurasilva/Register_For_New.git
fatal: remote origin already exists.
C:\wamp\www\PhpProject>git push -u origin master
fatal: unable to access 'https:github.com/vidurasilva/loging_Form.git/': Couldn't resolve host 'github.com'
C:\wamp\www\PhpProject>git remote set-url origin git#github.com:vidurasilva/Register_Form_New.git
C:\wamp\www\PhpProject>git push -u origin --all
ssh: Could not resolve hostname github.com: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
C:\wamp\www\PhpProject>git clone https:github.com/vidurasilva/Register_Form_New.git
Cloning into Register_Form_New...
fatal: unable to access https:github.com/vidurasilva/Register_Form_New.git/: Couldn't resolve host github.com
Try this:
git remote remove origin
git remote add https://github.com/vidurasilva/Register_Form_New.git
git push origin master
Further assistance is available in this article from GitHub support.
First fix this
git remote add origin https:github.com/vidurasilva/Register_For_New.git
with this
git remote add origin https://github.com/vidurasilva/Register_For_New.git
Then fix this
git clone https:github.com/vidurasilva/Register_Form_New.git
with this
git clone https://github.com/vidurasilva/Register_Form_New.git
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.
I want to add a file into github as follow:
git init
touch test.txt
git add test.tst
git cmmit -m'testtest'
git push origin master
then it will raise this exception:
error: The requested URL returned error: 403 while accessing https://github.com/yacheng1127/YWProject.git/info/refs
fatal: HTTP request failed
then I verify the public key is attached to my github account:
$ ssh -T git#github.com
Hi yacheng1127! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh-add -l
2048 1a:a1:33:26:21:68:7e:9c:26:19:fb:74:a4:d1:6b:bd yacheng1127#gmail.com (RSA)
then I check my remote url:
$ git remote -vorigin
origin https://github.com/yacheng1127/YWProject.git (fetch)
origin https://github.com/yacheng1127/YWProject.git (push)
I don't know where is the problem. could somebody help me? thank you
Use ssh key is used when you use the "git://" url for your remote, you can change this (https://help.github.com/articles/changing-a-remote-s-url).
But "https://" should work too (read/write), but it can't use your ssh key nor ssh agent, you should give git your github login and password :
https://help.github.com/articles/set-up-git#password-caching