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.