Решение ошибки remote: Permission to user/repo denied to user/other-repo. fatal: unable to access user/repo: The requested URL returned error: 403
Дата: 27.03.2017
В данном уроке рассмотрим варианты решения данной оишбки:
remote: Permission to user/repo denied to user/other-repo.
fatal: unable to access user/repo: The requested URL returned error: 403
Возникает она чаще всего у новичков при попытке выполнить команду:
$ git push
Пример ошибки на скриншоте ниже.
Данная ошибка возникает довольно часто при работе с Git в терминале Windows. Суть ошибка довольно таки простая, но почему-то в интернете постоянно создаются темы с вопросом на данную тему и нет внятного ответа на русском языке.
Ошибка говорит нам о том, что мы пытаемся отправить данные в чужой репозиторий. И о том, что текущий пользователь Git не имеет прав для отправки данных в указанный в команде репозиторий.
Существует два способа решить данную ошибку:
Вариант 1. Дать текущему пользователю права для работы с репозиторием
Данный способ подойдет, если вы являетесь владельцем обеих учетных записей указанных в ошибке. Необходимо зайти на GitHub под именем того пользователя, в чей репозиторий вы не можете отправить данные. В настройках репозитория указать необходимого соавтора. Ему на почту отправится приглашение, которое необходимо подтвердить, перейдя по ссылке в письме.
После этого вы сможете работать с репозиторием как со своим и ошибка больше не появится.
Вариант 2. Назначить в системе текущим пользователем Git ту учетную запись, в которую не можете отправить данные
Для этого необходимо перейти в Панель управления Windows. Выбрать отображение в виде категорий.
Перейти в раздел “Учетные записи пользователей и семейная безопасность”. Далее в раздел “Диспетчер учетных данных”. В самом низу будет блок “Общие учетные данные”. Нажмите в нем ссылку “Удаление из хранилища”.
После этого при попытке выполнить команду:
$ git push -u origin master
Терминал запросит у вас пароль от учетной записи на Github в чей репозиторий вы пытаетесь отправить данные.
После ввода пароля система установит данного пользователя как основного и будет использовать его в дальнейшем при работе с Git.
Надеюсь данный пост поможет вам решить ошибку, с которой я разбирался почти сутки.
git
github
Не забудьте сказать спасибо. Поставьте лайк!
Здравствуйте.
—
1) Вы пытаетесь загрузить с другого аккаунта, выйти из него я не знаю как, но зато, при установке git на ваш компьютер, создаётся файл .githistory
, обычно пихается в пользовательскую папку, как и данные по composer. (for Windows) — для других систем не узнавал.
2) Если вы нашли .githistory
— и используете другой аккаунт, удалите его. Возможно другие файлы со словом git так же стоит удалить.
3) Убедитесь, что вы после удаления истории сделали новую регистрацию:
$ git config --global user.name 'login'
$ git config --global user.email 'mail@yourmail.ru'
4) Когда создаёте репозиторий на GitHub , клонируйте его на свой компьютер.
Чтобы убедится, что вы открыли консоль [Git Bash] в нужном месте, просто сделайте команду$ git status
Если репозиторий и директория верны, он красным подсветит файлы, которые нужно добавить.
Если он пишет, что такой директории не существует, значит перейдите в вашу папку.$ cd your_folder
— ещё раз проверьте статус.
Если git увидел ваш склонированный репозиторий, значит делайте запрос:$ git add .
или$ git add --all
Почему я не начал с $ git init
?
Если вы склонировали, то папка .git
там уже есть.
Закидывайте к этой папке и файлу README.md ваши файлы, и делайте $ git add .
Только теперь можно делать коммиты$ git commit -m "your commit"
высветились все файлы? Тогда пропускаете $ git remote add origin....
— потому что ветка уже создана, при создании репозитория на сайте.
Теперь мы загружаем:$ git push -u origin master
Если не ошибаюсь, дописать записанное можно через команду:$ git pull
—-
Самое главное, это сменить пользователя на того, у которого есть права, иначе вам не поможет удаление программы и установка новой. Есть команда, которая чистит кеш истории$ git credential-cache exit
Но она почему-то в последнее время бесполезная и нерабочая, так что ищите способ очистить кеш.
Что касается ключей и ssh — их можно и не создавать, но как показывает практика, не только git , но и composer не дадут вам работать.
Успехов вам, надеюсь помог.
—
P.S. данный метод мне помог, если вы видите содержимое файла README.md смотрите в settings что у вас за ошибка, устраните её, и обновите браузер. Возможно, ещё придётся выбрать тему, или указать описание, так же смотрите, где у вас галочки стоят, они тоже могут вызвать головную боль.
This issue was moved to a discussion.
You can continue the conversation there.
Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
sunnytranco opened this issue
Apr 19, 2017
· 78 comments
Comments
When I finish step 3 of the wizard, this error shows up:
error: The requested URL returned error: 403 Forbidden while accessing https://sunnytranco:{password}@github.com/sunnytranco/gravLearn2.git/info/refs fatal: HTTP request failed
I’ve already tested my connection, it’s fine
Make sure the password is actually correct, I know it sounds like a stupid advice but I did have this issue myself before 😃. Also, if you are using 2FA with GitHub, you cannot use the actual password from remote, you need to create an Access Token and use that instead of your password.
EmillkaakillmE, mhatifi-cloud, C71-clan, saurabhagarwal8, itsMeNoName, ahrensv, QuiqueMartinez, lavecart, ashishsharma0286, mahruskh, and 9 more reacted with thumbs down emoji
SkyhawksCode, rahul9044, solsdv, and Hasnain-Raza-Gaho reacted with laugh emoji
urvisuthar85, mhatifi-cloud, anilrayamajhi, DominikKor, chuck-tz, TasnimJahan, vagman, and Abhishek111103 reacted with confused emoji
I’m having this issue on public repo, which was private before. This means there are no passwords to be entered
You do still a password even if it’s public. The authentication is required in order to guarantee you have PUSH permissions.
My bad, I got confused there, I was still required to enter credentials (ofcause)
how can I create an access token
Hi @Amina-Zafar , it depends on the Git-based service you are using. For example, with GitHub you could create a token at https://github.com/settings/tokens
unable to push my code into my current account, getting access denied 403 error. I have tried many options making new repos, by changing drive, even created repo on Bitbucket but still, my repo is associated with my colleague GitHub account. Please guide me how can I resolve this issue?
Pushp1992, Cawleeflower, and saikiran413 reacted with confused emoji
I have viewed this video but this is not my problem solution. Actually, my repo is public and my colleague repo is also public. The problem is, I am unable to push my code into my account repo this is the main problem that I am facing. Please help me.
Moreover, when I push my code into GitHub then give the error, ‘access denied from my colleague account’, which is no more login on my laptop.
This sounds less like a GitSync Plugin issue and more of a Git/GitHub issue… sorry but I don’t think I can be of any help with that.
Have the same issue with my repo. Who managed this or anyone who can help?
That error means you are using wrong credential or wrong repo:
- Username needs to be the user, not the email
- Ensure you provide the proper password. If you have 2FA enabled on GitHub, you need to make sure you create an Access Token with proper access permissions and use the token as password instead.
- Repo format is:
https://github.com/<user>/<repo>.git
403 means GitHub is not granting you access so one or more of the 3 things above are the problem
SamikshaWarang09 reacted with laugh emoji
tarokh0010, SamikshaWarang09, silersundragon, Waleed21221, kakkerenisujatha, caprica-Six, and vishnu96ray reacted with hooray emoji
Can anyone please help me ASAP, with below-mentioned error on cmd terminal of vscode while the last step(git push -u origin master) to push my project.
D:ReactJS Projectsresort>git push -u origin master
remote: Permission to kirtanwadekar/react-beach-resort-recording.git denied to kabir19.
fatal: unable to access ‘https://github.com/kirtanwadekar/react-beach-resort-recording.git/’: The requested URL returned error: 403
D:ReactJS Projectsresort>
403 means credentials errors or that you don’t have permission to push.
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
rsinghrahul0007, StiliyanPopov, JavierMartinez5, Nastya1028, ltrint, Umair113, joelpires, mohtaz11, Sebastien0DE, rdmammad, and 9 more reacted with laugh emoji
rsinghrahul0007, StiliyanPopov, JavierMartinez5, furkan-arslan, Nastya1028, ltrint, arn8tas, joelpires, senthilkumarthangavel, h1nguyenkhanh, and 18 more reacted with hooray emoji
robodempsey, iamoperand, nutririseinternal, SiyuLiu0, mustafa-meco, rsinghrahul0007, StiliyanPopov, JavierMartinez5, ataur-neub, pauld001, and 39 more reacted with heart emoji
StiliyanPopov, JavierMartinez5, Nastya1028, ltrint, arn8tas, joelpires, mak9456, kienvan102, mohtaz11, ActiveDev1, and 14 more reacted with rocket emoji
mohtaz11, Sebastien0DE, ArtistaVeKaras, marker2601, Shakilf, shaonodane, and NjoodAlmousabhi reacted with eyes emoji
$ git push origin master
remote: Permission to rajunerugatti123/secondrepo.git denied to nerugattiraju1234.
fatal: unable to access ‘https://github.com/rajunerugatti123/secondrepo.git/’: The requested URL returned error: 403
i will get this type of error. how it can solve
Hi People,
ILLYAS-DEULECT has already given us the answer. I was facing the same problem mentioned by rajunerugatti123, w00fz, Amina-Zafar . I followed the steps below and was able to resolve the issue
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
LuisMauricioFalla, mohtaz11, sean-cunniffe, FlaEuf, and pratik149 reacted with laugh emoji
mohtaz11, jmbey, VeroFlores, FlaEuf, and pratik149 reacted with hooray emoji
hibanebli, abdullahnayem, mohtaz11, dacosta007, AleSilvaRivera, jmbey, sean-cunniffe, FlaEuf, and pratik149 reacted with heart emoji
RamazanBarut, hamzajamil1997, mohtaz11, jmbey, FlaEuf, and pratik149 reacted with rocket emoji
I had the same issue and the solution provided by ILLYAS-DEULECT worked.
Thank you ILLYAS-DEULECT
Hello,
I personnally solved this problem by doing the following on the command line
git remote set-url origin https://yourusername@github.com/user/repo.git
Best,
Actually, the exact way is git remote set-url origin +your repository URL, I resolved this issue by this way, also thanks
Hi People,
ILLYAS-DEULECT has already given us the answer. I was facing the same problem mentioned by rajunerugatti123, w00fz, Amina-Zafar . I followed the steps below and was able to resolve the issue
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
how to resolve this issue in linux
For macOS try this for https problem:
git config --global credential.helper osxkeychain
Then try pull, push and it should ask for username and password.
For Mac
If you have the below setting
git config --global credential.helper osxkeychain
And your credentials are correct in the «Keychain Access» app.
Deleting all the Github internet passwords. Now when you try to push, Git will try to authenticate you again by asking for username/password, or take you to Github auth page.
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
For those whose problem is not solved in this way…
I strongly recommend to check that you have the permission to push to the repo. To make sure, ask the repo’s admin to give you the WRITE permission in the ‘Manage Access‘ section of the repo’s settings.
Hope this works for you.
Hi People,
ILLYAS-DEULECT has already given us the answer. I was facing the same problem mentioned by rajunerugatti123, w00fz, Amina-Zafar . I followed the steps below and was able to resolve the issue
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
what about on Linux… every solution i see is mac or windows what about linux
Working again. Thank you.
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
Thank you m-illyas this worked
I cloned a repo, did some edits, and tried to push to my own repo. This gave me the error
fatal: unable to access 'https://github.com/matterport/Mask_RCNN.git/': The requested URL returned error: 403
So I checked
1. git remote -v
2. git remote rm origin
Checked now that git remote -v
is empty
Then added the correct URL
1. git remote add origin git@github.com:magedhelmy1/x.git
2. git push -u origin master
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
Such a solid solution although it didn’t work completely for my case I have been trying to push my data to a different account SO in order to solve that.
I had to add two more steps on this solution and it worked just fine.
git config --global user.name "new-name"
git config --global user.email "email for my second account"
and that got it to work for me… am not sure why it didn’t work without changing the name and email though.
Please correct the path for windows:
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:
control panel > user accounts > credential manager > Windows credentials > Generic credentials
Correct:
Control panel > Credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the "internet password" entry for github.com.
4-Edit or delete the entry accordingly.
Thank you. Its working fine. Its really helpful. Great
May be, you clone someone else’s repo and now you are trying to push that repo into your own account. You will not be able to do that.
In trying to push origin master…
Fatal: unable to access ‘https://…/’: Failed to connect to GitHub.com port 443: Bad access
Please how can I solve this problem
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
This was the savage reply. It worked well.
That error is bad credentials
following @m-illyas steps solved my issue.
while creating personal access token make sure to select scopes.(just selecting repo should be fine)
remove existing credentials in ‘windows credentials’
I was getting the same «403 error. Permission to write to gist denied», when trying to clone a gist repo with https.
Repo format is: https://github.com//.git
Here’s how I fixed it:
- Created Personal Access Token, as per docs.
- Ticked — gist — Create gists.
- Login — username, which is user, not email (as mentioned above)
- Password — this is the Access token — paste
Now all is working fine. I am able to commit.
El error puede ser que la computadora haya guardado un nombre de usuario y contraseña de git, por lo que si cambia a otra cuenta, aparecerá el error 403. A continuación se muestra la solución
para Windows, puede encontrar las claves aquí:panel de control> cuentas de usuario> administrador de credenciales> credenciales de Windows> credenciales genéricas
A continuación, elimine las claves de Github.
En Mac
1-In Finder, busque la aplicación Keychain Access.
2 En Acceso a llaveros, busque github.com.
3-Busque la entrada «contraseña de Internet» para github.com.
4-Edite o elimine la entrada según corresponda.
efectivamente esta solución me sirvió….muchas graciassss.
fatal: unable to access ‘https://github.com/blablabla/Annotations.git/’: The requested URL returned error: 403
So I tried it now and got an error like this. In my opinion, the reason for this error is indirectly because the other party does not allow the project.
Hi People,
ILLYAS-DEULECT has already given us the answer. I was facing the same problem mentioned by rajunerugatti123, w00fz, Amina-Zafar . I followed the steps below and was able to resolve the issue
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
Hello…I did the same but the error still persists. What do I do ?
The error may be, the computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:control panel > user accounts > credential manager > Windows credentials > Generic credentials
Next, remove the Github keys.
In mac
1-In Finder, search for the Keychain Access app.
2In Keychain Access, search for github.com.
3-Find the «internet password» entry for github.com.
4-Edit or delete the entry accordingly.
Thank you. This solved my problem
Thank you. Its working fine. Its really helpful. Great
trilbymedia
locked and limited conversation to collaborators
Jun 14, 2021
This issue was moved to a discussion.
You can continue the conversation there.
Go to discussion →