I've cloned github repository with SourceTree.
During installing SourceTree I've authentificated with my GutHub account.
After cloning I've made first changes and trying to commit and push. Commit works fine, but push throws exception:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
remote: Permission to KamikyIT/VkWCF.git denied to sergeypyrkin.
fatal: unable to access 'https://github.com/KamikyIT/VkWCF.git/': The requested URL returned error: 403
Pushing to https://github.com/KamikyIT/VkWCF.git
What I can see is that I am not sergeypyrkin.
Check in command-line your credential helper:
git config credential.helper
Depending on your OS, that helper might have cached the wrong credentials (wrong username/password) associated to github.com
Related
I am trying to push some edits from my local repo to my GitHub but I get this error:
(base) herasyed#MacBook-Air-3 MechaCar_Statistical_Analysis % git add .
(base) herasyed#MacBook-Air-3 MechaCar_Statistical_Analysis % git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .DS_Store
renamed: MechaCarChallenge.R -> R Code/MechaCarChallenge.R
(base) herasyed#MacBook-Air-3 MechaCar_Statistical_Analysis % git push
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/herasyed/MechaCar_Statistical_Analysis.git/'
I can pull from my Git fine and my SSH key seems to be working.
my SSH key seems to be working.
Your SSH key is not used at all, considering the remote URL used is an HTTPS one.
If you want to use SSH:
cd /path/to/repo
git remote set-url origin git#github.com:herasyed/MechaCar_Statistical_Analysis.git
git push
See if the push succeeds then.
Trying to push a committed file to an existing remote repository on GitHub.
Below I verified and I'm trying to push to the Django. I've tried git push, and git push -u Django master. Any help would be appreciated. I have been saving all of my files locally and I am now adding all to GitHub and it's a little confusing.
Roberts-MBP:Django robertamato$ git remote -v
Django https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (fetch)
Django https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (push)
origin https://github.com/CodingDojo-Python-09-04/RobertAmato (fetch)
origin https://github.com/CodingDojo-Python-09-04/RobertAmato (push)
Roberts-MBP:Django robertamato$
Here is a error code it threw, I see it suggests to fetch first but I'm not to familiar with how that process works.
Roberts-MBP:Django robertamato$ git push -u Django master
To https://github.com/CodingDojo-Python-09-04/Robert_Amato.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/CodingDojo-Python-09-04/Robert_Amato.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
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 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
After I issued
git push origin <branch-name>
and entered the access credentials, Git returned an error like so
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/<account-name>/<repository-name>.git'
What seems to be the problem?
The GitHub help page, "Error: Repository not found" summarizes the possible causes:
permission (which is what Monika refers to in the comments with "Cloned directly from repo…get error when pushing")
You might need to fork the repo, and, on your local repo, do a:
git remote rename origin upstream
git remote add origin https://YourUsername#github.com/YourUsername/YourFork
spelling: the name of the repo is case sensitive
non-existent repo