0

I have created a repository in my laptop, added a new index.html file to that repository , staged, commited, then I created a repository on github account. After that I pushed a repo to github. It was done successfully.

Then, I forked that repository with my other github account, cloned it to another directory in my laptop, added new changes, then I wanted to push this forked new repository which located in my laptop to this second github account. But console shows me an error like this:

Counting objects: 3, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 310 bytes | 155.00 KiB/s, done.

Total 3 (delta 1), reused 0 (delta 0)

remote: Resolving deltas: 100% (1/1), completed with 1 local object.

To https://github.com/username/repo.git

! [remote rejected] master -> master (permission denied)

error: failed to push some refs to 'https://github.com/username/repo.git'

I would like to push repository to github as in this tutorial

I have searched about this error, and I did git pull --rebase and even git push - f https://github.com/account_name/repo.git but these commands did not help to solve this error.

How can I push the repository to github?

P.S. Written github account name is conditional.

jundev
  • 159
  • 1
  • 1
  • 11
  • Possible duplicate of [Multiple github accounts on the same computer?](https://stackoverflow.com/questions/3860112/multiple-github-accounts-on-the-same-computer) – phd Feb 26 '18 at 20:29
  • I think no, I would like to do like this: [link](https://youtu.be/HbSjyU2vf6Y?t=4m23s) @phd – jundev Feb 26 '18 at 20:37
  • @nihat, do you have write access to the repository? – ChrisGPT was on strike Feb 26 '18 at 21:44
  • I have checked this situation in other laptop. When I try to push forked repository to second account, it was done with successfully. I think, the problem was that I was attempting to access two account in a laptop. – jundev Feb 27 '18 at 19:23

0 Answers0