I have recently created a new Github account, and want to upload my project onto the repository that I created on my new account.
I have tried my level best to change the git credentials in my system, by changing the username and email:
git config --global user.name "newusername"
git config --global user.email emailID
However, when I try to push the contents onto the Github repository, it shows me the following error:
remote: Permission to newusername/repositoryname.git denied to oldusername
fatal: unable to access 'url': The requested URL returned error: 403
I have tried my best to have the issue resolved, but I am unable to come up with an exact reason and solution on why this issue is occurring. Any help would be greatly appreciated. Thanks.
Delete the github credentials in the windows credential manager:
http://www.digitalcitizen.life/credential-manager-where-windows-stores-passwords-other-login-details
Git should ask you again...
Related
in Visual studio code
i spent a lot more time for this, I'm trying push my deleted project that is coming from 1st account github into an existing repository in new another account, but I'm getting error like this :
$ git push -u origin main
remote: Permission to username/project_name.git denied to first_account_username.
fatal: unable to access 'https://github.com/user_name/project_name.git/': The requested URL returned error: 403
i tried those command line for push an existing repository in new account, please let me know what'd i miss ?
git remote add origin https://github.com/user_name/project_name.git
git branch -M main
git push -u origin main
Git obviously tries to push code to your new repository using your old username. Add you new username explicitly to the URL:
git remote set-url origin https://user_name#github.com/user_name/project_name.git
Or use the SSH syntax:
git remote set-url origin user_name#github.com:user_name/project_name.git
Question :
$ git push -u origin main
remote: Permission to username/project_name.git denied to another_username
fatal: unable to access 'https://github.com/user_name/project_name.git/': The requested URL returned error: 403
Answer :
Above the Setting icon in visual studio code there will be a Account Sign in logo icon, click and check it is login with another account or not ?
If it is log in with another Account you will be get the same error continuously... So,
The solution is : You should sign out the other Account in the visual studio and then try in visual studio code terminal following code given below...
$ git push
Then it will ask username and password
you should enter the correct details and it will work perfectly.
Just see the same problem and here is my solution:
Before we generate the token. We need to enable some elements of "select scopes in github settings as show below.
I just select several elements and generate key. Therefore I can push the code after fill username and password(generated key).
Check what configuration helper you do have: it might have cached the wrong credentials (from the old users).
git config --global credential helper
Adjust you PATH to use said credential helper.
If you are on Windows, in a CMD, set a simplified PATH like:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set "GH=%ProgramFiles%\Git"
set "PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%"
Then type in the same CMD:
printf "Host=bitbucket.org\nprotocol=https\nusername=old_username" | git credential-manager-core erase
Replace:
manager-core by your actual credential helper, as returned by git config --global credential helper
old_username by the old username GitHub account
Then try again.
First check your credentials:
git config --global user.name
git config --global user.email
Then change with:
git config --global user.name "email"
git config --global user.email "email#email.com"
If you set another credential before, will have problem
use git config credential.username "username"
git config shows correct user name and email and yet I cannot ever git push to my own repo on GitHub. It always says some old username that was used
git config user.name mqshaikh8
git config user.email mqshaikh8#gmail.com
git push origin master
remote: Permission to mqshaikh8/amigo.git denied to kshaikh99.
fatal: unable to access 'https://github.com/mqshaikh8/amigo.git/': The requested URL returned error: 403
git remote --v
origin https://github.com/mqshaikh8/amigo.git (fetch)
origin https://github.com/mqshaikh8/amigo.git (push)
It happened to me quite a bit, mostly after a typo in my password and couldn't ever type a password again.
Usually installing git bash again over the old installation fixes the problem.
If you're using the default settings/windows credentials the please see this github issue on git for desktop to help you on this matter.
This SO post on how to remove git credentials might also help.
Finally what worked is the following:
I was logged into windows as kshaikh99. Since git integrated with windows credential manager, it had cached the kshaikh99 username and password and regardless of what's in git config user.name and user.email, it always used that credential to authenticate and that's why it was failing.
I just signed off and signed into windows as mqshaikh8. Then when I tried to git push origin master, I got a windows credential dialog box to enter my mqshaikh8 username and password. I entered that and it works with no issues.
I am getting next error:
$ git push -u origin master
remote: Permission to teddyruns/medals.git denied to franciswebdevelopment
fatal: unable to access 'https://github.com/teddyruns/medals.git/': The requested URL returned error: 403
I have checked my global user name and email, and created a new ssh key, but franciswebdevelopment is my old account,
I have no idea why I can't push to my new account,
Does anybody have any idea where I am going wrong?
but franciswebdevelopment is my old account
That means you probably have a git crendential helper which has cached the credentials franciswebdevelopment for github.com.
git config credential.helper
If that is the case, remove that entry:
git credential-manager delete https://github.com
Then try again (but not right now, with HTTPS or SSH, because GitHub is experiencing a major outage)
Github is currently experiencing issues,
Click here to check their status.
I initialized a repo in my GitHub. I issued a git clone command. I went to the directory in my local computer where I wanted to clone the repo. Then I copied some files in my local drive. Then I did:
git add .
git commit
git push -u origin master
The message appeared:
remote: Permission to jasonkid1/testuli.git denied to jpamittan.
fatal: unable to access
'https://jasonkid1#github.com/jasonkid1/testuli.git/': The requested
URL returned error: 403
How can I fix this?
For any https authentication issue, you need to check your credential caching:
git config credential.helper
That is:
On Windows, for instance, you would need to open the Windows Credential Manager and check the right password was entered.
On Mac, you would need to update the OSX keychain.
You might have credentials for any github.com URL associated to jpamittan (wrong user) instead of jasonkid1.
I have created a repository on github named pygame. Created a clone and added files and commited.but when I attempt to push I receive the following error:
git push -u origin master
error: The requested URL returned error: 403 while accessing https://github.com/amalapk/pygame/info/refs
fatal: HTTP request failed
I can ssh to git#github.com and receive the notice that I logged in successfully, but can't push to my repository.
I recently experienced this problem when setting up a new clone of my github project.
You need to include your username in the URL to your project, in the form
https://user#github.com/project/...
For example, the URL provided for my test github is this:
https://github.com/jdblair/test.git
If I add my username to it, like this, then I'm able to push and pull from github with no problem:
https://jdblair#github.com/jdblair/test.git
It is easiest to use the URL that contains the username starting from when you clone a project.
You can change the URL for an existing project like this:
git remote set-url origin https://user#github.com/project/foo/bar.git
You can use the ssh authentication instead if you want, but that's a separate setup process.
Github now is asking us to use git 1.7.10 or later:
https://help.github.com/articles/error-the-requested-url-returned-error-403
The GitHub Remote page mentions the read/write addresses for a repo:
Make sure your clone address is like:
https://github.com/username/yourRepo.git
And that you have defined:
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email#youremail.com"
Should you use a git address (without ssh), you would also need:
git config --global github.user username
git config --global github.token 0123456789yourf0123456789token # no longer needed
(with your token coming from “Account Settings” > Click “Account Admin.”)
Update 2013: you still can generate a token (see "Creating an access token for command-line use"), but you would use it as a password for https url.
Actually, if you activate the 2FA (two-factor authentication) mechanism on GitHub, you will need a token for your https url (because your regular password would trigger the second-step verification).
See "Configure Git clients, like GitHub for Windows, to not ask for authentication"
See more at "Which remote URL should I use?".
It's all in the remote.
Change your current remote from https://github.com/amalapk/pygame.git to git#github.com:amalapk/pygame.git and enjoy.
To do this... (assuming your current remote is called origin)
git remote set-url origin git#github.com:amalapk/pygame.git
In my case getting rid of such error message was resolved this way:
Person was simply added to github repository as a colaborator.
Thats it - error vanished magically.
Committing to github from server this is what worked for me in the terminal or git bash
To create a remote to github.com try:
git remote add origin https://put your username here#github.com/put your git username here/put your repository name here
To change the remote just do:
git remote set-url origin https://put your username here#github.com/put your git username here/the name of your repository here
Please follow the instructions on http://help.github.com/create-a-repo/
You have cloned your repository with the public read only url.
RTFM